lib/worldwide/zip.rb in worldwide-0.11.0 vs lib/worldwide/zip.rb in worldwide-0.14.0
- old
+ new
@@ -83,10 +83,10 @@
# @param strip_extraneous_characters [String] Allow additional stripping of characters to either fully numeric or alphanumeric depending on the country.
# @return [String] The postal code with spaces inserted/removed and other formatting fixes applied.
def normalize(country_code:, zip:, allow_autofill: true, strip_extraneous_characters: false)
input = zip # preserve the original zip, in case we need to fall back to it
- return input if country_code.nil?
+ return input if Util.blank?(country_code)
country = Worldwide.region(code: country_code)
return zip if country.nil? || NORMALIZATION_DISABLED_COUNTRIES.include?(country.iso_code)
if allow_autofill