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