mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 14:43:33 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
269 lines
2.7 KiB
TypeScript
269 lines
2.7 KiB
TypeScript
// Loaded from https://deno.land/x/segno@v1.1.0/lib/validations/isISO31661Alpha3.ts
|
|
|
|
|
|
// @ts-ignore allowing typedoc to build
|
|
import { assertString } from '../helpers/assertString.ts';
|
|
// @ts-ignore allowing typedoc to build
|
|
import { includes } from '../helpers/includes.ts';
|
|
|
|
// from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
|
/**
|
|
* @ignore
|
|
*/
|
|
const validISO31661Alpha3CountriesCodes = [
|
|
'AFG',
|
|
'ALA',
|
|
'ALB',
|
|
'DZA',
|
|
'ASM',
|
|
'AND',
|
|
'AGO',
|
|
'AIA',
|
|
'ATA',
|
|
'ATG',
|
|
'ARG',
|
|
'ARM',
|
|
'ABW',
|
|
'AUS',
|
|
'AUT',
|
|
'AZE',
|
|
'BHS',
|
|
'BHR',
|
|
'BGD',
|
|
'BRB',
|
|
'BLR',
|
|
'BEL',
|
|
'BLZ',
|
|
'BEN',
|
|
'BMU',
|
|
'BTN',
|
|
'BOL',
|
|
'BES',
|
|
'BIH',
|
|
'BWA',
|
|
'BVT',
|
|
'BRA',
|
|
'IOT',
|
|
'BRN',
|
|
'BGR',
|
|
'BFA',
|
|
'BDI',
|
|
'KHM',
|
|
'CMR',
|
|
'CAN',
|
|
'CPV',
|
|
'CYM',
|
|
'CAF',
|
|
'TCD',
|
|
'CHL',
|
|
'CHN',
|
|
'CXR',
|
|
'CCK',
|
|
'COL',
|
|
'COM',
|
|
'COG',
|
|
'COD',
|
|
'COK',
|
|
'CRI',
|
|
'CIV',
|
|
'HRV',
|
|
'CUB',
|
|
'CUW',
|
|
'CYP',
|
|
'CZE',
|
|
'DNK',
|
|
'DJI',
|
|
'DMA',
|
|
'DOM',
|
|
'ECU',
|
|
'EGY',
|
|
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LW',
|
|
'PSE',
|
|
'PAN',
|
|
'PNG',
|
|
'PRY',
|
|
'PER',
|
|
'PHL',
|
|
'PCN',
|
|
'POL',
|
|
'PRT',
|
|
'PRI',
|
|
'QAT',
|
|
'REU',
|
|
'ROU',
|
|
'RUS',
|
|
'RWA',
|
|
'BLM',
|
|
'SHN',
|
|
'KNA',
|
|
'LCA',
|
|
'MAF',
|
|
'SPM',
|
|
'VCT',
|
|
'WSM',
|
|
'SMR',
|
|
'STP',
|
|
'SAU',
|
|
'SEN',
|
|
'SRB',
|
|
'SYC',
|
|
'SLE',
|
|
'SGP',
|
|
'SXM',
|
|
'SVK',
|
|
'SVN',
|
|
'SLB',
|
|
'SOM',
|
|
'ZAF',
|
|
'SGS',
|
|
'SSD',
|
|
'ESP',
|
|
'LKA',
|
|
'SDN',
|
|
'SUR',
|
|
'SJM',
|
|
'SWZ',
|
|
'SWE',
|
|
'CHE',
|
|
'SYR',
|
|
'TWN',
|
|
'TJK',
|
|
'TZA',
|
|
'THA',
|
|
'TLS',
|
|
'TGO',
|
|
'TKL',
|
|
'TON',
|
|
'TTO',
|
|
'TUN',
|
|
'TUR',
|
|
'TKM',
|
|
'TCA',
|
|
'TUV',
|
|
'UGA',
|
|
'UKR',
|
|
'ARE',
|
|
'GBR',
|
|
'USA',
|
|
'UMI',
|
|
'URY',
|
|
'UZB',
|
|
'VUT',
|
|
'VEN',
|
|
'VNM',
|
|
'VGB',
|
|
'VIR',
|
|
'WLF',
|
|
'ESH',
|
|
'YEM',
|
|
'ZMB',
|
|
'ZWE',
|
|
];
|
|
|
|
export const isISO31661Alpha3 = (str: string) => {
|
|
assertString(str);
|
|
return includes(validISO31661Alpha3CountriesCodes, str.toUpperCase());
|
|
};
|