-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
539 additions
and
14 deletions.
There are no files selected for viewing
262 changes: 262 additions & 0 deletions
262
packages/i18nify-js/src/modules/geo/data/countryListForAllFlags.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,262 @@ | ||
import { CountryCodeTypeForAllFlags } from '../../types'; | ||
|
||
export const COUNTRY_LIST_FOR_ALL_FLAGS: CountryCodeTypeForAllFlags[] = [ | ||
'AD', | ||
'AE', | ||
'AF', | ||
'AG', | ||
'AI', | ||
'AL', | ||
'AM', | ||
'AO', | ||
'AQ', | ||
'AR', | ||
'AS', | ||
'AT', | ||
'AU', | ||
'AW', | ||
'AX', | ||
'AZ', | ||
'BA', | ||
'BB', | ||
'BD', | ||
'BE', | ||
'BF', | ||
'BG', | ||
'BH', | ||
'BI', | ||
'BJ', | ||
'BL', | ||
'BM', | ||
'BN', | ||
'BO', | ||
'BQ-BO', | ||
'BQ-SA', | ||
'BQ-SE', | ||
'BQ', | ||
'BR', | ||
'BS', | ||
'BT', | ||
'BV', | ||
'BW', | ||
'BY', | ||
'BZ', | ||
'CA', | ||
'CC', | ||
'CD', | ||
'CF', | ||
'CG', | ||
'CH', | ||
'CI', | ||
'CK', | ||
'CL', | ||
'CM', | ||
'CN', | ||
'CO', | ||
'CR', | ||
'CU', | ||
'CV', | ||
'CW', | ||
'CX', | ||
'CY', | ||
'CZ', | ||
'DE', | ||
'DJ', | ||
'DK', | ||
'DM', | ||
'DO', | ||
'DZ', | ||
'EC', | ||
'EE', | ||
'EG', | ||
'EH', | ||
'ER', | ||
'ES', | ||
'ET', | ||
'FI', | ||
'FJ', | ||
'FK', | ||
'FM', | ||
'FO', | ||
'FR', | ||
'GA', | ||
'GB-ENG', | ||
'GB-NIR', | ||
'GB-SCT', | ||
'GB-UKM', | ||
'GB-WLS', | ||
'GB', | ||
'GD', | ||
'GE', | ||
'GF', | ||
'GG', | ||
'GH', | ||
'GI', | ||
'GL', | ||
'GM', | ||
'GN', | ||
'GP', | ||
'GQ', | ||
'GR', | ||
'GS', | ||
'GT', | ||
'GU', | ||
'GW', | ||
'GY', | ||
'HK', | ||
'HM', | ||
'HN', | ||
'HR', | ||
'HT', | ||
'HU', | ||
'ID', | ||
'IE', | ||
'IL', | ||
'IM', | ||
'IN', | ||
'IO', | ||
'IQ', | ||
'IR', | ||
'IS', | ||
'IT', | ||
'JE', | ||
'JM', | ||
'JO', | ||
'JP', | ||
'KE', | ||
'KG', | ||
'KH', | ||
'KI', | ||
'KM', | ||
'KN', | ||
'KP', | ||
'KR', | ||
'KW', | ||
'KY', | ||
'KZ', | ||
'LA', | ||
'LB', | ||
'LC', | ||
'LI', | ||
'LK', | ||
'LR', | ||
'LS', | ||
'LT', | ||
'LU', | ||
'LV', | ||
'LY', | ||
'MA', | ||
'MC', | ||
'MD', | ||
'ME', | ||
'MF', | ||
'MG', | ||
'MH', | ||
'MK', | ||
'ML', | ||
'MM', | ||
'MN', | ||
'MO', | ||
'MP', | ||
'MQ', | ||
'MR', | ||
'MS', | ||
'MT', | ||
'MU', | ||
'MV', | ||
'MW', | ||
'MX', | ||
'MY', | ||
'MZ', | ||
'NA', | ||
'NC', | ||
'NE', | ||
'NF', | ||
'NG', | ||
'NI', | ||
'NL', | ||
'NO', | ||
'NP', | ||
'NR', | ||
'NU', | ||
'NZ', | ||
'OM', | ||
'PA', | ||
'PE', | ||
'PF', | ||
'PG', | ||
'PH', | ||
'PK', | ||
'PL', | ||
'PM', | ||
'PN', | ||
'PR', | ||
'PS', | ||
'PT', | ||
'PW', | ||
'PY', | ||
'QA', | ||
'RE', | ||
'RO', | ||
'RS', | ||
'RU', | ||
'RW', | ||
'SA', | ||
'SB', | ||
'SC', | ||
'SD', | ||
'SE', | ||
'SG', | ||
'SH', | ||
'SI', | ||
'SJ', | ||
'SK', | ||
'SL', | ||
'SM', | ||
'SN', | ||
'SO', | ||
'SR', | ||
'SS', | ||
'ST', | ||
'SV', | ||
'SX', | ||
'SY', | ||
'SZ', | ||
'TC', | ||
'TD', | ||
'TF', | ||
'TG', | ||
'TH', | ||
'TJ', | ||
'TK', | ||
'TL', | ||
'TM', | ||
'TN', | ||
'TO', | ||
'TR', | ||
'TT', | ||
'TV', | ||
'TW', | ||
'TZ', | ||
'UA', | ||
'UG', | ||
'UM', | ||
'US', | ||
'UY', | ||
'UZ', | ||
'VA', | ||
'VC', | ||
'VE', | ||
'VG', | ||
'VI', | ||
'VN', | ||
'VU', | ||
'WF', | ||
'WS', | ||
'YE', | ||
'YT-UNF', | ||
'YT', | ||
'ZA', | ||
'ZM', | ||
'ZW', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { LIST_OF_ALL_COUNTRIES } from './data/listOfAllCountries'; | ||
import { COUNTRY_LIST_FOR_ALL_FLAGS } from './data/countryListForAllFlags'; | ||
|
||
export function isCountryValid(_countryCode: string): boolean { | ||
export function isCountryValidForFlags(_countryCode: string): boolean { | ||
const countryCode = _countryCode.toUpperCase(); | ||
// @ts-expect-error countryCode here can be a random string | ||
return LIST_OF_ALL_COUNTRIES.includes(countryCode); | ||
return COUNTRY_LIST_FOR_ALL_FLAGS.includes(countryCode); | ||
} |
Oops, something went wrong.