use in rather than keys().includes()

This commit is contained in:
Samuel Newman
2025-12-10 19:22:05 +02:00
parent 7a6aa60e7d
commit 08c4ad1811
+1 -3
View File
@@ -1254,11 +1254,9 @@ export const INTERNATIONAL_TELEPHONE_CODES = {
const DEFAULT_PHONE_COUNTRY = 'US'
export function getDefaultCountry(location?: {countryCode?: string}) {
const supportedCountries = Object.keys(INTERNATIONAL_TELEPHONE_CODES)
if (
location?.countryCode &&
supportedCountries.includes(location.countryCode.toUpperCase())
location.countryCode.toUpperCase() in INTERNATIONAL_TELEPHONE_CODES
) {
return location.countryCode.toUpperCase()
}