Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brixtol/country-names

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brixtol/country-names - npm Package Compare versions

Comparing version 1.2.0 to 1.4.0

29

changelog.md
## _CHANGELOG_
### 1.4.0 - 01/12/2021
- Fixed `KG` (Kyrgyzstan)
- Changes `Saint Barthelemy` to official name `Saint Barthélemy`
### 1.2.4 - 24/11/2021
- Added `XK` (Republic of Kosovo)
- Added `BN` (Brunei Darussalam)
### 1.2.2 - 21/11/2021
- Minor internal updates
- Moved to esbuild minifier
- pnpm linked dependencies
- dropped const enum `Country` export
- Updated docs
### 1.2.1 - 05/11/2021
Improved type support and provided error handling for when invalid or incorrect ISO codes are provided.
- Added literal union support for argument `code`
- Added type support for country name reference of return
- Added error support when an unmatched ISO is provided
- Appended "(DPRK)" to "North Korea" country name.
- Added const enum `Country` export which uses Country Names to map ISO codes
- Exposed ISO code Union type to export
### 1.2.0 - 24/10/2021

@@ -4,0 +33,0 @@

18

package.json
{
"name": "@brixtol/country-names",
"version": "1.2.0",
"version": "1.4.0",
"description": "Mappings for 2 letter (Alpha 2) country codes to English country name",

@@ -38,3 +38,6 @@ "author": {

"ignorePatterns": "package",
"extends": "@brixtol/eslint-config"
"extends": "@brixtol/eslint-config",
"rules": {
"no-unused-vars": "off"
}
},

@@ -52,8 +55,12 @@ "ava": {

"@brixtol/eslint-config": "^1.0.1",
"@brixtol/prettier-config": "^1.2.0",
"@brixtol/prettier-config": "^1.2.1",
"@brixtol/rollup-config": "^1.4.0",
"@brixtol/tsconfig": "^1.0.0",
"ava": "^3.15.0",
"esm": "^3.2.25",
"typescript": "^4.3.5"
"typescript": "^4.5.2"
},
"dependencies": {
"@brixtol/tsutils": "^1.4.1"
},
"scripts": {

@@ -63,4 +70,5 @@ "dev": "rollup -c -w",

"package": "cd versions; pnpm pack ../ && cd ..",
"test": "ava --watch --verbose"
"test": "ava --watch --verbose",
"test:build": "ava --verbose"
}
}

@@ -0,1 +1,2 @@

import { LiteralUnion, AnyCase } from '@brixtol/tsutils';
export interface ICountries {

@@ -54,3 +55,5 @@ /** Andorra */

BM: 'Bermuda';
/** Bolivia, Plurinational State */
/** Brunei Darussalam */
BN: 'Brunei Darussalam';
/** Bolivia; Plurinational State */
BO: 'Bolivia';

@@ -240,3 +243,3 @@ /** Bonaire Sint Eustatius And Saba */

/** North Korea */
KP: 'North Korea,';
KP: 'North Korea (DPRK)';
/** Korea The Republic Of */

@@ -474,5 +477,5 @@ KR: 'South Korea';

VC: 'Saint Vincent and the Grenadines';
/** Virgin Islands, British */
/** Virgin Islands; British */
VG: 'Virgin Islands, British';
/** Virgin Islands, U.S */
/** Virgin Islands; U.S */
VI: 'Virgin Islands, U.S';

@@ -487,2 +490,4 @@ /** Viet Nam */

WS: 'Samoa';
/** Republic of Kosovo */
XK: 'Republic of Kosovo';
/** Yemen */

@@ -500,11 +505,534 @@ YE: 'Yemen';

/**
* Country code Keys (3166-1 alpha-2)
* Type Annotated Union
*
* This is a temporary workaround for `keyof` not passing
* JSDocs annotations declared on interface properties when
* converting to union types.
*
* Until this is available in TypeScript, the unions are
* hardcoded work-around.
*
* @see https://github.com/microsoft/TypeScript/issues/41531
*/
export declare type CountryCodes<T = keyof ICountries> = T;
export declare const Countries: ICountries;
export declare type CountryCodes = (
/** Andorra */
'AD' |
/** United Arab Emirates */
'AE' |
/** Afghanistan */
'AF' |
/** Antigua And Barbuda */
'AG' |
/** Anguilla */
'AI' |
/** Albania */
'AL' |
/** Armenia */
'AM' |
/** Angola */
'AO' |
/** Argentina */
'AR' |
/** American Samoa */
'AS' |
/** Austria */
'AT' |
/** Australia */
'AU' |
/** Aruba */
'AW' |
/** Aland Islands */
'AX' |
/** Azerbaijan */
'AZ' |
/** Bosnia And Herzegovina */
'BA' |
/** Barbados */
'BB' |
/** Bangladesh */
'BD' |
/** Belgium */
'BE' |
/** Burkina Faso */
'BF' |
/** Bulgaria */
'BG' |
/** Bahrain */
'BH' |
/** Burundi */
'BI' |
/** Benin */
'BJ' |
/** Saint Barthelemy */
'BL' |
/** Bermuda */
'BM' |
/** Brunei Darussalam */
'BN' |
/** Bolivia | Plurinational State */
'BO' |
/** Bonaire Sint Eustatius And Saba */
'BQ' |
/** Brazil */
'BR' |
/** Bahamas */
'BS' |
/** Bhutan */
'BT' |
/** Bouvet Island */
'BV' |
/** Botswana */
'BW' |
/** Belarus */
'BY' |
/** Belize */
'BZ' |
/** Canada */
'CA' |
/** Cocos Keeling Islands */
'CC' |
/** Congo The Democratic Republic */
'CD' |
/** Central African Republic */
'CF' |
/** The Congo */
'CG' |
/** Switzerland */
'CH' |
/** Cote Divoire */
'CI' |
/** Cook Islands */
'CK' |
/** Chile */
'CL' |
/** Cameroon */
'CM' |
/** China */
'CN' |
/** Colombia */
'CO' |
/** Costa Rica */
'CR' |
/** Cuba */
'CU' |
/** Cabo Verde */
'CV' |
/** Curacao */
'CW' |
/** Christmas Island */
'CX' |
/** Cyprus */
'CY' |
/** Czech Republic */
'CZ' |
/** Germany */
'DE' |
/** Djibouti */
'DJ' |
/** Denmark */
'DK' |
/** Dominica */
'DM' |
/** Dominican Republic */
'DO' |
/** Algeria **/
'DZ' |
/** Ecuador */
'EC' |
/** Estonia */
'EE' |
/** Egypt */
'EG' |
/** Western Sahara */
'EH' |
/** Eritrea */
'ER' |
/** Spain */
'ES' |
/** Ethiopia */
'ET' |
/** Finland */
'FI' |
/** Fiji */
'FJ' |
/** Falkland Islands Malvinas */
'FK' |
/** Micronesia Federated States */
'FM' |
/** Faroe Islands */
'FO' |
/** France */
'FR' |
/** Gabon */
'GA' |
/** United Kingdom Of Great Britain and Northern Ireland */
'GB' |
/** Grenada */
'GD' |
/** Georgia */
'GE' |
/** French Guiana */
'GF' |
/** Guernsey */
'GG' |
/** Ghana */
'GH' |
/** Gibraltar */
'GI' |
/** Greenland */
'GL' |
/** Gambia */
'GM' |
/** Guinea */
'GN' |
/** Guadeloupe */
'GP' |
/** Equatorial Guinea */
'GQ' |
/** Greece */
'GR' |
/** South Georgia and The South Sandwich Islands */
'GS' |
/** Guatemala */
'GT' |
/** Guam */
'GU' |
/** Guinea Bissau */
'GW' |
/** Guyana */
'GY' |
/** Hong Kong */
'HK' |
/** Heard Island And Mcdonald Islands */
'HM' |
/** Honduras */
'HN' |
/** Croatia */
'HR' |
/** Haiti */
'HT' |
/** Hungary */
'HU' |
/** Indonesia */
'ID' |
/** Ireland */
'IE' |
/** Israel */
'IL' |
/** Isle Of Man */
'IM' |
/** India (Indian Rupee) */
'IN' |
/** British Indian Ocean Territory */
'IO' |
/** Iraq */
'IQ' |
/** Iran Islamic Republic */
'IR' |
/** Iceland */
'IS' |
/** Italy */
'IT' |
/** Jersey */
'JE' |
/** Jamaica */
'JM' |
/** Jordan */
'JO' |
/** Japan */
'JP' |
/** Kenya */
'KE' |
/** Kazakhstan */
'KG' |
/** Cambodia */
'KH' |
/** Kiribati */
'KI' |
/** Comoros */
'KM' |
/** Saint Kitts And Nevis */
'KN' |
/** North Korea */
'KP' |
/** Korea The Republic Of */
'KR' |
/** Kuwait */
'KW' |
/** Cayman Islands */
'KY' |
/** Kazakhstan */
'KZ' |
/** Lao Peoples Democratic Republic */
'LA' |
/** Lebanon */
'LB' |
/** Saint Lucia */
'LC' |
/** Liechtenstein */
'LI' |
/** Sri Lanka */
'LK' |
/** Liberia */
'LR' |
/** Lesotho */
'LS' |
/** Lithuania */
'LT' |
/** Luxembourg */
'LU' |
/** Latvia */
'LV' |
/** Libya */
'LY' |
/** Morocco */
'MA' |
/** Monaco */
'MC' |
/** Moldova Republic */
'MD' |
/** Montenegro */
'ME' |
/** Saint Martin French Part */
'MF' |
/** Madagascar */
'MG' |
/** Marshall Islands */
'MH' |
/** Republic Of North Macedonia */
'MK' |
/** Mali */
'ML' |
/** Myanmar */
'MM' |
/** Mongolia */
'MN' |
/** Macao (Pataca) */
'MO' |
/** Northern Mariana Islands */
'MP' |
/** Martinique */
'MQ' |
/** Mauritania */
'MR' |
/** Montserrat */
'MS' |
/** Malta */
'MT' |
/** Mauritius */
'MU' |
/** Maldives */
'MV' |
/** Malawi */
'MW' |
/** Mexico */
'MX' |
/** Malaysia */
'MY' |
/** Mozambique */
'MZ' |
/** Namibia */
'NA' |
/** New Caledonia */
'NC' |
/** Niger */
'NE' |
/** Norfolk Island */
'NF' |
/** Nigeria */
'NG' |
/** Nicaragua */
'NI' |
/** Netherlands */
'NL' |
/** Norway */
'NO' |
/** Nepal */
'NP' |
/** Nauru */
'NR' |
/** Niue */
'NU' |
/** New Zealand */
'NZ' |
/** Oman */
'OM' |
/** Panama */
'PA' |
/** Peru */
'PE' |
/** French Polynesia */
'PF' |
/** Papua New Guinea */
'PG' |
/** Philippines */
'PH' |
/** Pakistan */
'PK' |
/** Poland */
'PL' |
/** Saint Pierre and Miquelon */
'PM' |
/** Pitcairn */
'PN' |
/** Puerto Rico */
'PR' |
/** Palestine */
'PS' |
/** Portugal */
'PT' |
/** Palau */
'PW' |
/** Paraguay */
'PY' |
/** Qatar */
'QA' |
/** Reunion */
'RE' |
/** Romania */
'RO' |
/** Serbia */
'RS' |
/** Russian Federation */
'RU' |
/** Rwanda */
'RW' |
/** Saudi Arabia */
'SA' |
/** Solomon Islands */
'SB' |
/** Seychelles */
'SC' |
/** Sudan */
'SD' |
/** Sweden */
'SE' |
/** Singapore (Singapore Dollar) */
'SG' |
/** Saint Helena Ascension And Tristan Da Cunha */
'SH' |
/** Slovenia */
'SI' |
/** Svalbard and Jan Mayen */
'SJ' |
/** Slovakia */
'SK' |
/** Sierra Leone */
'SL' |
/** San Marino */
'SM' |
/** Senegal */
'SN' |
/** Somalia */
'SO' |
/** Suriname */
'SR' |
/** South Sudan */
'SS' |
/** Sao Tome And Principe */
'ST' |
/** El Salvador */
'SV' |
/** Sint Maarten */
'SX' |
/** Syrian Arab Republic */
'SY' |
/** Swaziland */
'SZ' |
/** Turks And Caicos Islands */
'TC' |
/** Chad */
'TD' |
/** French Southern Territories */
'TF' |
/** Togo */
'TG' |
/** Thailand */
'TH' |
/** Tajikistan */
'TJ' |
/** Tokelau */
'TK' |
/** Timor Leste */
'TL' |
/** Turkmenistan */
'TM' |
/** Tunisia */
'TN' |
/** Tonga */
'TO' |
/** Turkey */
'TR' |
/** Trinidad And Tobago */
'TT' |
/** Tuvalu */
'TV' |
/** Taiwan */
'TW' |
/** Tanzania United Republic */
'TZ' |
/** Ukraine */
'UA' |
/** Uganda */
'UG' |
/** United States Minor Outlying Islands */
'UM' |
/** United States Of America */
'US' |
/** Uruguay */
'UY' |
/** Uzbekistan */
'UZ' |
/** Holy See */
'VA' |
/** Saint Vincent And The Grenadines */
'VC' |
/** Virgin Islands | British */
'VG' |
/** Virgin Islands | U.S */
'VI' |
/** Viet Nam */
'VN' |
/** Vanuatu */
'VU' |
/** Wallis And Futuna */
'WF' |
/** Republic of Kosovo */
'XK' |
/** Samoa */
'WS' |
/** Yemen */
'YE' |
/** Mayotte */
'YT' |
/** South Africa */
'ZA' |
/** Zambia */
'ZM' |
/** Zimbabwe */
'ZW');
/**
* 2 Letter (Alpha 2) country code
* Country Name
*
* _Accepts either uppercase or lowercase_
* Extracts the country name from the ICountries interface
* which is use as the Return type reference
*/
export declare const getCountryName: (code: CountryCodes) => string;
export declare type CountryName<ISO> = (ISO extends CountryCodes ? ICountries[ISO] : never);
/**
* Countries Map
*
* Country code (ISO 3166-1 alpha-2) to country name
* **Readonly** object.
*/
export declare const Countries: Readonly<ICountries>;
/**
* Get Country Name
*
* Requires a 2 Letter (ISO 3166-1 alpha-2) country
* code to be passed and returns the country name
* in English.
*
* > _Accepts either uppercase, lowercase or
* or a combination of either_
*/
export declare function getCountryName<ISO extends AnyCase<CountryCodes>>(code: LiteralUnion<ISO>): CountryName<Uppercase<ISO>>;

@@ -1,1 +0,1 @@

const a=Object.freeze({AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua And Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"NOK",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Colombia",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Micronesia, Federated States",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"GIP",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea ",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and Mcdonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran, Islamic Republic",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kazakhstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea,",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao Peoples Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova Republic",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands ",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena, Ascension and Tristan da Cunha",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syrian Arab Republic",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor Leste",TM:"Turkmenistan",TN:"Tunisia ",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania, United Republic",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States of America",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See",VC:"Saint Vincent and the Grenadines",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S",VN:"Viet Nam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"}),n=n=>a[n.toUpperCase()];export{a as Countries,n as getCountryName};
const i=Object.freeze({AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua And Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"\xC5land Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"NOK",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"C\xF4te d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Colombia",CU:"Cuba",CV:"Cabo Verde",CW:"Cura\xE7ao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Micronesia, Federated States",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"GIP",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea ",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and Mcdonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran, Islamic Republic",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kazakhstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea (DPRK)",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao Peoples Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova Republic",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands ",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena, Ascension and Tristan da Cunha",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syrian Arab Republic",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor Leste",TM:"Turkmenistan",TN:"Tunisia ",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania, United Republic",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States of America",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See",VC:"Saint Vincent and the Grenadines",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S",VN:"Viet Nam",VU:"Vanuatu",WF:"Wallis and Futuna",XK:"Republic of Kosovo",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"});function e(a){const n=i[a.toUpperCase()];if(!n)throw new Error(`"${a}" is an invalid ISO country code`);return n}export{i as Countries,e as getCountryName};

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const a=Object.freeze({AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua And Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"NOK",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Colombia",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Micronesia, Federated States",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"GIP",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea ",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and Mcdonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran, Islamic Republic",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kazakhstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea,",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao Peoples Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova Republic",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands ",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena, Ascension and Tristan da Cunha",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syrian Arab Republic",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor Leste",TM:"Turkmenistan",TN:"Tunisia ",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania, United Republic",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States of America",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See",VC:"Saint Vincent and the Grenadines",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S",VN:"Viet Nam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"});exports.Countries=a,exports.getCountryName=n=>a[n.toUpperCase()];
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const i=Object.freeze({AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua And Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"\xC5land Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"NOK",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Congo, Democratic Republic",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"C\xF4te d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Colombia",CU:"Cuba",CV:"Cabo Verde",CW:"Cura\xE7ao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Micronesia, Federated States",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"GIP",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea ",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and Mcdonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran, Islamic Republic",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kazakhstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea (DPRK)",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao Peoples Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova Republic",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands ",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena, Ascension and Tristan da Cunha",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syrian Arab Republic",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor Leste",TM:"Turkmenistan",TN:"Tunisia ",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania, United Republic",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States of America",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See",VC:"Saint Vincent and the Grenadines",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S",VN:"Viet Nam",VU:"Vanuatu",WF:"Wallis and Futuna",XK:"Republic of Kosovo",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"});function e(a){const n=i[a.toUpperCase()];if(!n)throw new Error(`"${a}" is an invalid ISO country code`);return n}exports.Countries=i,exports.getCountryName=e;

@@ -7,4 +7,4 @@ ## @brixtol/country-names

Minified: 4.04 KB <br>
Gzipped: 2.18 KB
Minified: 4.15 KB <br>
Gzipped: 2.25 KB

@@ -16,7 +16,5 @@ ### Install

```cli
pnpm i @brixtol/country-names
pnpm add @brixtol/country-names
```
##### Boomer / Sheep Alternatives
[npm](https://www.npmjs.com/)

@@ -46,7 +44,9 @@

The module also exposes the raw mappings and interface on the export. The mappings object is provided **read only** using [Object.freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze).
###### EXTRAS
```javascript
import { Countries, ICountries, CountryCodes } from '@brixtol/country-names';
The module also exposes the raw mappings and interface on the export. The mappings object is provided **read only** using [Object.freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze). In addition to the raw mappings a ISO code union export is also exposed.
```ts
import { Countries, ICountries, CountryCodes, Country } from '@brixtol/country-names';
// Mapping Object

@@ -64,5 +64,6 @@

// Country Codes
// Country Code Union
CountryCodes: // SE | NL | RU etc etc
CountryCodes<'SE' | 'NL' | 'RU'>; // etc etc
```

@@ -74,2 +75,6 @@

Static GeoIP utility
- [@brixtol/i18n](https://github.com/brixtol/i18n)
Country code to currency code mappings:

@@ -76,0 +81,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc