Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
193 views
in Technique[技术] by (71.8m points)

Using Javascript Code in Zapier to return Two Letter ISO Country Code

I have a functioning Zapier Email parser that provides a country name that I need to submit into Salesforce as a Two Letter Country Code as part of a lead.

From what I am reading, this should be possible using the Code function of Zapier, and Javascript.

I found a javascript code that appears to work in other situations, but I am not familiar with Javascript to be able to troubleshoot this further.

When I run this using the input of "name" as the parsed country, it gives an error of SyntaxError: Unexpected template string

Screenshot - Zapier Setup

Screenshot - Zapier Error

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

convertCountryCode = (code) => {
    return isoCountries[code].name;
}```
question from:https://stackoverflow.com/questions/65713200/using-javascript-code-in-zapier-to-return-two-letter-iso-country-code

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm by no means a javascript expert but am a huge Zapier fan. I reworked your code a bit and think this should work.

/* jshint  esversion: 6 */
const isoCountries = [
  {
    code: 'AF',
    name: 'Afghanistan'
  },
  {
    code: 'AX',
    name: 'Aland Islands'
  },
  {
    code: 'AL',
    name: 'Albania'
  },
  {
    code: 'DZ',
    name: 'Algeria'
  },
  {
    code: 'AS',
    name: 'American Samoa'
  },
  {
    code: 'AD',
    name: 'Andorra'
  },
  {
    code: 'AO',
    name: 'Angola'
  },
  {
    code: 'AI',
    name: 'Anguilla'
  },
  {
    code: 'AQ',
    name: 'Antarctica'
  },
  {
    code: 'AG',
    name: 'Antigua And Barbuda'
  },
  {
    code: 'AR',
    name: 'Argentina'
  },
  {
    code: 'AM',
    name: 'Armenia'
  },
  {
    code: 'AW',
    name: 'Aruba'
  },
  {
    code: 'AU',
    name: 'Australia'
  },
  {
    code: 'AT',
    name: 'Austria'
  },
  {
    code: 'AZ',
    name: 'Azerbaijan'
  },
  {
    code: 'BS',
    name: 'Bahamas'
  },
  {
    code: 'BH',
    name: 'Bahrain'
  },
  {
    code: 'BD',
    name: 'Bangladesh'
  },
  {
    code: 'BB',
    name: 'Barbados'
  },
  {
    code: 'BY',
    name: 'Belarus'
  },
  {
    code: 'BE',
    name: 'Belgium'
  },
  {
    code: 'BZ',
    name: 'Belize'
  },
  {
    code: 'BJ',
    name: 'Benin'
  },
  {
    code: 'BM',
    name: 'Bermuda'
  },
  {
    code: 'BT',
    name: 'Bhutan'
  },
  {
    code: 'BO',
    name: 'Bolivia'
  },
  {
    code: 'BA',
    name: 'Bosnia And Herzegovina'
  },
  {
    code: 'BW',
    name: 'Botswana'
  },
  {
    code: 'BV',
    name: 'Bouvet Island'
  },
  {
    code: 'BR',
    name: 'Brazil'
  },
  {
    code: 'IO',
    name: 'British Indian Ocean Territory'
  },
  {
    code: 'BN',
    name: 'Brunei Darussalam'
  },
  {
    code: 'BG',
    name: 'Bulgaria'
  },
  {
    code: 'BF',
    name: 'Burkina Faso'
  },
  {
    code: 'BI',
    name: 'Burundi'
  },
  {
    code: 'KH',
    name: 'Cambodia'
  },
  {
    code: 'CM',
    name: 'Cameroon'
  },
  {
    code: 'CA',
    name: 'Canada'
  },
  {
    code: 'CV',
    name: 'Cape Verde'
  },
  {
    code: 'KY',
    name: 'Cayman Islands'
  },
  {
    code: 'CF',
    name: 'Central African Republic'
  },
  {
    code: 'TD',
    name: 'Chad'
  },
  {
    code: 'CL',
    name: 'Chile'
  },
  {
    code: 'CN',
    name: 'China'
  },
  {
    code: 'CX',
    name: 'Christmas Island'
  },
  {
    code: 'CC',
    name: 'Cocos (Keeling) Islands'
  },
  {
    code: 'CO',
    name: 'Colombia'
  },
  {
    code: 'KM',
    name: 'Comoros'
  },
  {
    code: 'CG',
    name: 'Congo'
  },
  {
    code: 'CD',
    name: 'Congo, Democratic Republic'
  },
  {
    code: 'CK',
    name: 'Cook Islands'
  },
  {
    code: 'CR',
    name: 'Costa Rica'
  },
  {
    code: 'CI',
    name: 'Cote D'Ivoire'
  },
  {
    code: 'HR',
    name: 'Croatia'
  },
  {
    code: 'CU',
    name: 'Cuba'
  },
  {
    code: 'CY',
    name: 'Cyprus'
  },
  {
    code: 'CZ',
    name: 'Czech Republic'
  },
  {
    code: 'DK',
    name: 'Denmark'
  },
  {
    code: 'DJ',
    name: 'Djibouti'
  },
  {
    code: 'DM',
    name: 'Dominica'
  },
  {
    code: 'DO',
    name: 'Dominican Republic'
  },
  {
    code: 'EC',
    name: 'Ecuador'
  },
  {
    code: 'EG',
    name: 'Egypt'
  },
  {
    code: 'SV',
    name: 'El Salvador'
  },
  {
    code: 'GQ',
    name: 'Equatorial Guinea'
  },
  {
    code: 'ER',
    name: 'Eritrea'
  },
  {
    code: 'EE',
    name: 'Estonia'
  },
  {
    code: 'ET',
    name: 'Ethiopia'
  },
  {
    code: 'FK',
    name: 'Falkland Islands (Malvinas)'
  },
  {
    code: 'FO',
    name: 'Faroe Islands'
  },
  {
    code: 'FJ',
    name: 'Fiji'
  },
  {
    code: 'FI',
    name: 'Finland'
  },
  {
    code: 'FR',
    name: 'France'
  },
  {
    code: 'GF',
    name: 'French Guiana'
  },
  {
    code: 'PF',
    name: 'French Polynesia'
  },
  {
    code: 'TF',
    name: 'French Southern Territories'
  },
  {
    code: 'GA',
    name: 'Gabon'
  },
  {
    code: 'GM',
    name: 'Gambia'
  },
  {
    code: 'GE',
    name: 'Georgia'
  },
  {
    code: 'DE',
    name: 'Germany'
  },
  {
    code: 'GH',
    name: 'Ghana'
  },
  {
    code: 'GI',
    name: 'Gibraltar'
  },
  {
    code: 'GR',
    name: 'Greece'
  },
  {
    code: 'GL',
    name: 'Greenland'
  },
  {
    code: 'GD',
    name: 'Grenada'
  },
  {
    code: 'GP',
    name: 'Guadeloupe'
  },
  {
    code: 'GU',
    name: 'Guam'
  },
  {
    code: 'GT',
    name: 'Guatemala'
  },
  {
    code: 'GG',
    name: 'Guernsey'
  },
  {
    code: 'GN',
    name: 'Guinea'
  },
  {
    code: 'GW',
    name: 'Guinea-Bissau'
  },
  {
    code: 'GY',
    name: 'Guyana'
  },
  {
    code: 'HT',
    name: 'Haiti'
  },
  {
    code: 'HM',
    name: 'Heard Island & Mcdonald Islands'
  },
  {
    code: 'VA',
    name: 'Holy See (Vatican City State)'
  },
  {
    code: 'HN',
    name: 'Honduras'
  },
  {
    code: 'HK',
    name: 'Hong Kong'
  },
  {
    code: 'HU',
    name: 'Hungary'
  },
  {
    code: 'IS',
    name: 'Iceland'
  },
  {
    code: 'IN',
    name: 'India'
  },
  {
    code: 'ID',
    name: 'Indonesia'
  },
  {
    code: 'IR',
    name: 'Iran, Islamic Republic Of'
  },
  {
    code: 'IQ',
    name: 'Iraq'
  },
  {
    code: 'IE',
    name: 'Ireland'
  },
  {
    code: 'IM',
    name: 'Isle Of Man'
  },
  {
    code: 'IL',
    name: 'Israel'
  },
  {
    code: 'IT',
    name: 'Italy'
  },
  {
    code: 'JM',
    name: 'Jamaica'
  },
  {
    code: 'JP',
    name: 'Japan'
  },
  {
    code: 'JE',
    name: 'Jersey'
  },
  {
    code: 'JO',
    name: 'Jordan'
  },
  {
    code: 'KZ',
    name: 'Kazakhstan'
  },
  {
    code: 'KE',
    name: 'Kenya'
  },
  {
    code: 'KI',
    name: 'Kiribati'
  },
  {
    code: 'KR',
    name: 'Korea'
  },
  {
    code: 'KW',
    name: 'Kuwait'
  },
  {
    code: 'KG',
    name: 'Kyrgyzstan'
  },
  {
    code: 'LA',
    name: 'Lao People's Democratic Republic'
  },
  {
    code: 'LV',
    name: 'Latvia'
  },
  {
    code: 'LB',
    name: 'Lebanon'
  },
  {
    code: 'LS',
    name: 'Lesotho'
  },
  {
    code: 'LR',
    name: 'Liberia'
  },
  {
    code: 'LY',
    name: 'Libyan Arab Jamahiriya'
  },
  {
    code: 'LI',
    name: 'Liechtenstein'
  },
  {
    code: 'LT',
    name: 'Lithuania'
  },
  {
    code: 'LU',
    name: 'Luxembourg'
  },
  {
    code: 'MO',
    name: 'Macao'
  },
  {
    code: 'MK',
    name: 'Macedonia'
  },
  {
    code: 'MG',
    name: 'Madagascar'
  },
  {
    code: 'MW',
    name: 'Malawi'
  },
  {
    code: 'MY',
    name: 'Malaysia'
  },
  {
    code: 'MV',
    name: 'Maldives'
  },
  {
    code: 'ML',
    name: 'Mali'
  },
  {
    code: 'MT',
    name: 'Malta'
  },
  {
    code: 'MH',
    name: 'Marshall Islands'
  },
  {
    code: 'MQ',
    name: 'Martinique'
  },
  {
    code: 'MR',
    name: 'Mauritania'
  },
  {
    code: 'MU',
    name: 'Mauritius'
  },
  {
    code: 'YT',
    name: 'Mayotte'
  },
  {
    code: 'MX',
    name: 'Mexico'
  },
  {
    code: 'FM',
    name: 'Micronesia, Federated States Of'
  },
  {
    code: 'MD',
    name: 'Moldova'
  },
  {
    code: 'MC',
    name: 'Monaco'
  },
  {
    code: 'MN',
    name: 'Mongolia'
  },
  {
    code: 'ME',
    name: 'Montenegro'
  },
  {
    code: 'MS',
    name: 'Montserrat'
  },
  {
    code: 'MA',
    name: 'Morocco'
  },
  {
    code: 'MZ',
    name: 'Mozambique'
  },
  {
    code: 'MM',
    name: 'Myanmar'
  },
  {
    code: 'NA',
    name: 'Namibia'
  },
  {
    code: 'NR',
    name: 'Nauru'
  },
  {
    code: 'NP',
    name: 'Nepal'
  },
  {
    code: 'NL',
    name: 'Netherlands'
  },
  {
    code: 'AN',
    name: 'Netherlands Antilles'
  },
  {
    code: 'NC',
    name: 'New Caledonia'
  },
  {
    code: 'NZ',
    name: 'New Zealand'
  },
  {
    code: 'NI',
    name: 'Nicaragua'
  },
  {
    code: 'NE',
    name: 'Niger'
  },
  {
    code: 'NG',
    name: 'Nigeria'
  },
  {
    code: 'NU',
    name: 'Niue'
  },
  {
    code: 'NF',
    name: 'Norfolk Island'
  },
  {
    code: 'MP',
    name: 'Northern Mariana Islands'
  },
  {
    code: 'NO',
    name: 'Norway'
  },
  {
    code: 'OM',
    name: 'Oman'
  },
  {
    code: 'PK',
    name: 'Pakistan'
  },
  {
    code: 'PW',
    name: 'Palau'
  },
  {
    code: 'PS',
    name: 'Palestinian Territory, Occupied'
  },
  {
    code: 'PA',
    name: 'Panama'
  },
  {
    code: 'PG',
    name: 'Papua New Guinea'
  },
  {
    code: 'PY',
    name: 'Paraguay'
  },
  {
    code: 'PE',
    name: 'Peru'
  },
  {
    code: 'PH',
    name: 'Philippines'
  },
  {
    code: 'PN',
    name: 'Pitcairn'
  },
  {
    code: 'PL',
    name: 'Poland'
  },
  {
    code: 'PT',
    name: 'Portugal'
  },
  {
    code: 'PR',
    name: 'Puerto Rico'
  },
  {
    code: 'QA',
    name: 'Qatar'
  },
  {
    code: 'RE',
    name: 'Reunion'
  },
  {
    code: 'RO',
    name: 'Romania'
  },
  {
    code: 'RU',
    name: 'Russian Federation'
  },
  {
    code: 'RW',
    name: 'Rwanda'
  },
  {
    code: 'BL',
    name: 'Saint Barthelemy'
  },
  {
    code: 'SH',
    name: 'Saint Helena'
  },
  {
    code: 'KN',
    name: 'Saint Kitts And Nevis'
  },
  {
    code: 'LC',
    name: 'Saint Lucia'
  },
  {
    code: 'MF',
    name: 'Saint Martin'
  },
  {
    code: 'PM',
    name: 'Saint Pierre And Miquelon'
  },
  {
    code: 'VC',
    name: 'Saint Vincent And Grenadines'
  },
  {
    code: 'WS',
    name: 'Samoa'
  },
  {
    code: 'SM',
    name: 'San Marino'
  },
  {
    code: 'ST',
    name: 'Sao Tome And Principe'
  },
  {
    code: 'SA',
    name: 'Saudi Arabia'
  },
  {
    code: 'SN',
    name: 'Senegal'
  },
  {
    code: 'RS',
    name: 'Serbia'
  },
  {
    code: 'SC',
    name: 'Seychelles'
  },
  {
    code: 'SL',
    name: 'Sierra Leone'
  },
  {
    code: 'SG',
    name: 'Singapore'
  },
  {
    code: 'SK',
    name: 'Slovakia'
  },
  {
    code: 'SI',
    name: 'Slovenia'
  },
  {
    code: 'SB',
    name: 'Solomon Islands'
  },
  {
    code: 'SO',
    name: 'Somalia'
  },
  {
    code: 'ZA',
    name: 'South Africa'
  },
  {
    code: 'GS',
    name: 'South Georgia And Sandwich Isl.'
  },
  {
    code: 'ES',
    name: 'Spain'
  },
  {
    code: 'LK',
    name: 'Sri Lanka'
  },
  {
    code: 'SD',
    name: 'Sudan'
  },
  {
    code: 'SR',
    name: 'Suriname'
  },
  {
    code: 'SJ',
    name: 'Svalbard And Jan Mayen'
  },
  {
    code: 'SZ',
    name: 'Swaziland'
  },
  {
    code: 'SE',
    name: 'Sweden'
  },
  {
    code: 'CH',
    name: 'Switzerland'
  },
  {
    code: 'SY',
    name: 'Syrian Arab Republic'
  },
  {
    code: 'TW',
    name: 'Taiwan'
  },
  {
    code: 'TJ',
    name: 'Tajikistan'
  },
  {
    code: 'TZ',
    name: 'Tanzania'
  },
  {
    code: 'TH',
    name: 'Thailand'
  },
  {
    code: 'TL',
    name: 'Timor-Leste'
  },
  {
    code: 'TG',
    name: 'Togo'
  },
  {
    code: 'TK',
    name: 'Tokelau'
  },
  {
    code: 'TO',
    name: 'Tonga'
  },
  {
    code: 'TT',
    name: 'Trinidad And Tobago'
  },
  {
    code: 'TN',
    name: 'Tunisia'
  },
  {
    code: 'TR',
    name: 'Turkey'
  },
  {
    code: 'TM',
    name: 'Turkmenistan'
  },
  {
 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...