@routebot/constants 0.3.42 → 0.3.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -209,21 +209,21 @@ module.exports = {
|
|
|
209
209
|
COUNTRIES,
|
|
210
210
|
COUNTRY_OPTIONS,
|
|
211
211
|
getCountryByCode: (code) => {
|
|
212
|
-
return COUNTRIES.find((country) => country.code === code);
|
|
212
|
+
return COUNTRIES.find((country) => country.code?.toUpperCase?.() === code?.toUpperCase?.());
|
|
213
213
|
},
|
|
214
214
|
getDialCodeByCountryCode: (code) => {
|
|
215
|
-
const country = COUNTRIES.find((c) => c.code
|
|
215
|
+
const country = COUNTRIES.find((c) => c.code?.toUpperCase?.() === code?.toUpperCase?.());
|
|
216
216
|
return country ? country.phonePrefix : null;
|
|
217
217
|
},
|
|
218
218
|
getCountryByPhonePrefix: (prefix) => {
|
|
219
|
-
return COUNTRIES.find((country) => country
|
|
219
|
+
return COUNTRIES.find((country) => country?.phonePrefix === prefix);
|
|
220
220
|
},
|
|
221
221
|
isSmsEnabledForCountry: (code) => {
|
|
222
|
-
const country = COUNTRIES.find((c) => c.code
|
|
222
|
+
const country = COUNTRIES.find((c) => c.code?.toUpperCase?.() === code?.toUpperCase?.());
|
|
223
223
|
return country ? country.smsEnabled : false;
|
|
224
224
|
},
|
|
225
225
|
getAllCountryCodesLowerCase: () => {
|
|
226
|
-
return COUNTRIES.map((country) => country.code
|
|
226
|
+
return COUNTRIES.map((country) => country.code?.toLowerCase?.());
|
|
227
227
|
},
|
|
228
228
|
getLocalizedCountryName,
|
|
229
229
|
};
|