Skip to content

Instantly share code, notes, and snippets.

@cjavad
Created November 30, 2020 22:54
Show Gist options
  • Save cjavad/057589a272fffbc9a301a98fa8a84796 to your computer and use it in GitHub Desktop.
Save cjavad/057589a272fffbc9a301a98fa8a84796 to your computer and use it in GitHub Desktop.
Every country (ISO3166) separated into enums based on region, inspired by the similar CountryByCode. This list takes geographical assumptions over political ones, meaning you'll find countries such as Ukraine under CIS while they actually withdrew in 2014 (Effective 2018).
/**
* Every country (ISO3166) split into geographical region.
* https://meta.wikimedia.org/wiki/List_of_countries_by_regional_classification
* https://en.wikipedia.org/wiki/Commonwealth_of_Independent_States#Member_states
* https://en.wikipedia.org/wiki/Southeast_Asia
*/
export namespace CountryByRegion {
export enum Europe {
AX = 'Aland Islands',
AL = 'Albania',
AD = 'Andorra',
AT = 'Austria',
BE = 'Belgium',
BG = 'Bulgaria',
HR = 'Croatia',
CY = 'Cyprus',
CZ = 'Czech Republic',
DK = 'Denmark',
EE = 'Estonia',
FO = 'Faroe Islands',
FI = 'Finland',
FR = 'France',
DE = 'Germany',
GI = 'Gibraltar',
GR = 'Greece',
GL = 'Greenland',
GG = 'Guernsey',
VA = 'Holy See Vatican City State',
HU = 'Hungary',
IS = 'Iceland',
IE = 'Ireland',
IM = 'Isle Of Man',
IT = 'Italy',
JE = 'Jersey',
LV = 'Latvia',
LI = 'Liechtenstein',
LT = 'Lithuania',
LU = 'Luxembourg',
MT = 'Malta',
MC = 'Monaco',
ME = 'Montenegro',
NL = 'Netherlands',
NO = 'Norway',
PL = 'Poland',
PT = 'Portugal',
RO = 'Romania',
SM = 'San Marino',
RS = 'Serbia',
SK = 'Slovakia',
SI = 'Slovenia',
ES = 'Spain',
SJ = 'Svalbard And Jan Mayen',
SE = 'Sweden',
CH = 'Switzerland',
TR = 'Turkey',
GB = 'United Kingdom'
}
// Europe and some of Asia is split into Europe, Greater Asia and CIS (Commonwealth of Independent States)
// This list includes the geograpical members that are or have been part of the CIS in some way or form.
export enum CIS {
AF = 'Afghanistan',
AM = 'Armenia',
AZ = 'Azerbaijan',
BY = 'Belarus',
GE = 'Georgia',
KZ = 'Kazakhstan',
KG = 'Kyrgyzstan',
MD = 'Moldova',
MN = 'Mongolia',
RU = 'Russian Federation',
TJ = 'Tajikistan',
TM = 'Turkmenistan',
UA = 'Ukraine',
UZ = 'Uzbekistan',
}
export enum Asia {
AS = 'American Samoa',
BD = 'Bangladesh',
BT = 'Bhutan',
BA = 'Bosnia and Herzegovina',
IO = 'British Indian Ocean Territory',
CN = 'China',
CK = 'Cook Islands',
HK = 'Hong Kong',
IN = 'India',
JP = 'Japan',
KI = 'Kiribati',
KR = 'Korea, Republic of',
KP = 'Korea, Democratic People\'s Republic of',
MO = 'Macao',
MV = 'Maldives',
MH = 'Marshall Islands',
NR = 'Nauru',
NP = 'Nepal',
PK = 'Pakistan',
TW = 'Taiwan'
}
// Asia is split into Greater Asia and South East Asia
export enum SEA {
CX = 'Christmas Island',
CC = 'Cocos Keeling Islands',
BN = 'Brunei Darussalam',
KH = 'Cambodia',
TL = 'Timor-Leste',
ID = 'Indonesia',
LA = 'Lao Peoples Democratic Republic',
MY = 'Malaysia',
MM = 'Myanmar',
PH = 'Philippines',
SG = 'Singapore',
TH = 'Thailand',
VN = 'Vietnam'
}
export enum Africa {
AO = 'Angola',
BJ = 'Benin',
BW = 'Botswana',
BF = 'Burkina Faso',
BI = 'Burundi',
CM = 'Cameroon',
CV = 'Cape Verde',
CF = 'Central African Republic',
TD = 'Chad',
CG = 'Congo',
CD = 'Congo Democratic Republic',
CI = 'Côte D\'Ivoire',
GQ = 'Equatorial Guinea',
ER = 'Eritrea',
ET = 'Ethiopia',
GA = 'Gabon',
GM = 'Gambia',
GH = 'Ghana',
GN = 'Guinea',
GW = 'Guinea Bissau',
KE = 'Kenya',
LS = 'Lesotho',
LR = 'Liberia',
MG = 'Madagascar',
MW = 'Malawi',
ML = 'Mali',
MU = 'Mauritius',
YT = 'Mayotte',
MZ = 'Mozambique',
NA = 'Namibia',
NE = 'Niger',
NG = 'Nigeria',
RE = 'Reunion',
RW = 'Rwanda',
SH = 'Saint Helena',
ST = 'Sao Tome And Principe',
SN = 'Senegal',
SC = 'Seychelles',
SL = 'Sierra Leone',
SO = 'Somalia',
ZA = 'South Africa',
SS = 'South Sudan',
LK = 'Sri Lanka',
SD = 'Sudan',
SZ = 'Swaziland',
TZ = 'Tanzania',
TG = 'Togo',
UG = 'Uganda',
EH = 'Western Sahara',
ZM = 'Zambia',
ZW = 'Zimbabwe'
}
export enum ArabStates {
DZ = 'Algeria',
BH = 'Bahrain',
KM = 'Comoros',
DJ = 'Djibouti',
MR = 'Mauritania',
MA = 'Morocco',
PS = 'Palestinian Territory',
TN = 'Tunisia'
}
export enum MiddleEast {
EG = 'Egypt',
IR = 'Iran',
IQ = 'Iraq',
IL = 'Israel',
JO = 'Jordan',
KW = 'Kuwait',
LB = 'Lebanon',
LY = 'Libyan Arab Jamahiriya',
OM = 'Oman',
QA = 'Qatar',
SA = 'Saudi Arabia',
SY = 'Syrian Arab Republic',
AE = 'United Arab Emirates',
YE = 'Yemen'
}
export enum NorthAmerica {
BM = 'Bermuda',
CA = 'Canada',
MX = 'Mexico',
PM = 'Saint Pierre And Miquelon',
US = 'United States'
}
export enum LatinAmerica {
AI = 'Anguilla',
AG = 'Antigua and Barbuda',
AW = 'Aruba',
BS = 'Bahamas',
BB = 'Barbados',
BZ = 'Belize',
BV = 'Bouvet Island',
KY = 'Cayman Islands',
CR = 'Costa Rica',
CU = 'Cuba',
CW = 'Curaçao',
DM = 'Dominica',
DO = 'Dominican Republic',
SV = 'El Salvador',
GD = 'Grenada',
GP = 'Guadeloupe',
GT = 'Guatemala',
HT = 'Haiti',
HN = 'Honduras',
JM = 'Jamaica',
MQ = 'Martinique',
MS = 'Montserrat',
NI = 'Nicaragua',
PA = 'Panama',
PR = 'Puerto Rico',
BL = 'Saint Barthelemy',
KN = 'Saint Kitts And Nevis',
LC = 'Saint Lucia',
MF = 'Saint Martin',
VC = 'Saint Vincent And Grenadines',
SX = 'Sint Maarten (Dutch part)',
TT = 'Trinidad And Tobago',
TC = 'Turks And Caicos Islands',
VG = 'Virgin Islands British',
VI = 'Virgin Islands US'
}
export enum SouthAmerica {
AR = 'Argentina',
BO = 'Bolivia',
BR = 'Brazil',
CL = 'Chile',
CO = 'Colombia',
EC = 'Ecuador',
FK = 'Falkland Islands',
GF = 'French Guiana',
GY = 'Guyana',
PY = 'Paraguay',
PE = 'Peru',
GS = 'South Georgia And Sandwich Island',
SR = 'Suriname',
UY = 'Uruguay',
VE = 'Venezuela',
}
export enum Oceania {
AQ = 'Antarctica',
AU = 'Australia',
FJ = 'Fiji',
PF = 'French Polynesia',
TF = 'French Southern Territories',
GU = 'Guam',
HM = 'Heard Island Mcdonald Islands',
FM = 'Micronesia',
NC = 'New Caledonia',
NZ = 'New Zealand',
NU = 'Niue',
NF = 'Norfolk Island',
MP = 'Northern Mariana Islands',
PW = 'Palau',
PG = 'Papua New Guinea',
PN = 'Pitcairn',
WS = 'Samoa',
SB = 'Solomon Islands',
TK = 'Tokelau',
TO = 'Tonga',
TV = 'Tuvalu',
UM = 'United States Outlying Islands',
VU = 'Vanuatu',
WF = 'Wallis And Futuna'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment