use in rather than keys().includes()
This commit is contained in:
@@ -1254,11 +1254,9 @@ export const INTERNATIONAL_TELEPHONE_CODES = {
|
|||||||
const DEFAULT_PHONE_COUNTRY = 'US'
|
const DEFAULT_PHONE_COUNTRY = 'US'
|
||||||
|
|
||||||
export function getDefaultCountry(location?: {countryCode?: string}) {
|
export function getDefaultCountry(location?: {countryCode?: string}) {
|
||||||
const supportedCountries = Object.keys(INTERNATIONAL_TELEPHONE_CODES)
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
location?.countryCode &&
|
location?.countryCode &&
|
||||||
supportedCountries.includes(location.countryCode.toUpperCase())
|
location.countryCode.toUpperCase() in INTERNATIONAL_TELEPHONE_CODES
|
||||||
) {
|
) {
|
||||||
return location.countryCode.toUpperCase()
|
return location.countryCode.toUpperCase()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user