@omnicar/sam-format
Advanced tools
Comparing version 0.0.49 to 0.0.50
@@ -61,3 +61,5 @@ "use strict"; | ||
var isInternationalFormat = (countryCode || init_1.defaults.countryCode) === 'International'; | ||
var useIsoCountry = !countryCode ? init_1.defaults.countryCode : countryCode; // Note: If no countryCode given, then use the "global" countryCode that is currently set. | ||
var useIsoCountry = !countryCode | ||
? init_1.defaults.countryCode || 'International' | ||
: countryCode; // Note: If no countryCode given, then use the "global" countryCode that is currently set. | ||
if (isInternationalFormat) { | ||
@@ -73,3 +75,3 @@ var normalizedPhone = phone.replace(/[ \-\.,()]/g, ''); // Note: WITHOUT the '+' char. | ||
if (!formats) { | ||
throw Error("You requested countryCode \"" + (!countryCode ? init_1.defaults.language : countryCode) + "\", but there are no phone formats for that countryCode"); | ||
throw Error("You requested countryCode \"" + (!countryCode ? init_1.defaults.countryCode : countryCode) + "\", but there are no phone formats for that countryCode"); | ||
} | ||
@@ -76,0 +78,0 @@ // Add space between area code and main number for spaced numbers. |
@@ -51,3 +51,3 @@ { | ||
}, | ||
"version": "0.0.49" | ||
"version": "0.0.50" | ||
} |
30244
768