2022-07-13 09:40:02 -07:00
|
|
|
/** List of supported E164 country codes. */
|
|
|
|
const COUNTRY_CODES = [
|
2022-07-13 15:37:40 -07:00
|
|
|
'1',
|
2022-09-26 13:00:01 -07:00
|
|
|
'351',
|
2022-07-13 15:37:40 -07:00
|
|
|
'44',
|
2022-09-26 13:00:01 -07:00
|
|
|
'55',
|
2022-07-13 09:40:02 -07:00
|
|
|
] as const;
|
|
|
|
|
|
|
|
/** Supported E164 country code. */
|
|
|
|
type CountryCode = typeof COUNTRY_CODES[number];
|
|
|
|
|
|
|
|
/** Check whether a given value is a country code. */
|
|
|
|
const isCountryCode = (value: any): value is CountryCode => COUNTRY_CODES.includes(value);
|
2022-03-21 11:09:01 -07:00
|
|
|
|
2022-07-13 09:40:02 -07:00
|
|
|
export {
|
|
|
|
COUNTRY_CODES,
|
|
|
|
CountryCode,
|
|
|
|
isCountryCode,
|
|
|
|
};
|