@sroussey/parse-address
Version:
International street address parser for 220 jurisdictions (US, CA + 218 countries and territories), with SEC EDGAR country-code resolution
278 lines • 22.7 kB
JavaScript
// AUTO-GENERATED from the SEC EDGAR "State or Country" code table.
// Maps each EDGAR foreign-country code to its modern ISO 3166-1 alpha-2 country
// (or null for obsolete codes with no single successor, e.g. Czechoslovakia).
// Source: https://www.sec.gov/submit-filings/filer-support-resources/edgar-state-country-codes
/** EDGAR foreign-country code (uppercase, e.g. "K3") -> country. */
export const secCountryCodes = {
"B2": { iso2: "AF", name: "Afghanistan", status: "current", inhabited: true },
"Y6": { iso2: "AX", name: "Aland Islands", status: "current", inhabited: true },
"B3": { iso2: "AL", name: "Albania", status: "current", inhabited: true },
"B4": { iso2: "DZ", name: "Algeria", status: "current", inhabited: true },
"B5": { iso2: "AS", name: "American Samoa", status: "current", inhabited: true },
"B6": { iso2: "AD", name: "Andorra", status: "current", inhabited: true },
"B7": { iso2: "AO", name: "Angola", status: "current", inhabited: true },
"1A": { iso2: "AI", name: "Anguilla", status: "current", inhabited: true },
"B8": { iso2: "AQ", name: "Antarctica", status: "current", inhabited: false },
"B9": { iso2: "AG", name: "Antigua and Barbuda", status: "current", inhabited: true },
"C1": { iso2: "AR", name: "Argentina", status: "current", inhabited: true },
"1B": { iso2: "AM", name: "Armenia", status: "current", inhabited: true },
"1C": { iso2: "AW", name: "Aruba", status: "current", inhabited: true },
"C3": { iso2: "AU", name: "Australia", status: "current", inhabited: true },
"C4": { iso2: "AT", name: "Austria", status: "current", inhabited: true },
"1D": { iso2: "AZ", name: "Azerbaijan", status: "current", inhabited: true },
"C5": { iso2: "BS", name: "Bahamas", status: "current", inhabited: true },
"C6": { iso2: "BH", name: "Bahrain", status: "current", inhabited: true },
"C7": { iso2: "BD", name: "Bangladesh", status: "current", inhabited: true },
"C8": { iso2: "BB", name: "Barbados", status: "current", inhabited: true },
"1F": { iso2: "BY", name: "Belarus", status: "current", inhabited: true },
"C9": { iso2: "BE", name: "Belgium", status: "current", inhabited: true },
"D1": { iso2: "BZ", name: "Belize", status: "current", inhabited: true },
"G6": { iso2: "BJ", name: "Benin", status: "current", inhabited: true },
"D0": { iso2: "BM", name: "Bermuda", status: "current", inhabited: true },
"D2": { iso2: "BT", name: "Bhutan", status: "current", inhabited: true },
"D3": { iso2: "BO", name: "Bolivia", status: "current", inhabited: true },
"1E": { iso2: "BA", name: "Bosnia and Herzegovina", status: "current", inhabited: true },
"B1": { iso2: "BW", name: "Botswana", status: "current", inhabited: true },
"D4": { iso2: "BV", name: "Bouvet Island", status: "current", inhabited: false },
"D5": { iso2: "BR", name: "Brazil", status: "current", inhabited: true },
"D6": { iso2: "IO", name: "British Indian Ocean Territory", status: "current", inhabited: false },
"D9": { iso2: "BN", name: "Brunei", status: "current", inhabited: true },
"E0": { iso2: "BG", name: "Bulgaria", status: "current", inhabited: true },
"X2": { iso2: "BF", name: "Burkina Faso", status: "current", inhabited: true },
"E2": { iso2: "BI", name: "Burundi", status: "current", inhabited: true },
"E3": { iso2: "KH", name: "Cambodia", status: "current", inhabited: true },
"E4": { iso2: "CM", name: "Cameroon", status: "current", inhabited: true },
"E8": { iso2: "CV", name: "Cape Verde", status: "current", inhabited: true },
"E9": { iso2: "KY", name: "Cayman Islands", status: "current", inhabited: true },
"F0": { iso2: "CF", name: "Central African Republic", status: "current", inhabited: true },
"F2": { iso2: "TD", name: "Chad", status: "current", inhabited: true },
"F3": { iso2: "CL", name: "Chile", status: "current", inhabited: true },
"F4": { iso2: "CN", name: "China", status: "current", inhabited: true },
"F6": { iso2: "CX", name: "Christmas Island", status: "current", inhabited: false },
"F7": { iso2: "CC", name: "Cocos (Keeling) Islands", status: "current", inhabited: false },
"F8": { iso2: "CO", name: "Colombia", status: "current", inhabited: true },
"F9": { iso2: "KM", name: "Comoros", status: "current", inhabited: true },
"G0": { iso2: "CG", name: "Congo (Republic)", status: "current", inhabited: true },
"Y3": { iso2: "CD", name: "Congo (Democratic Republic)", status: "current", inhabited: true },
"G1": { iso2: "CK", name: "Cook Islands", status: "current", inhabited: true },
"G2": { iso2: "CR", name: "Costa Rica", status: "current", inhabited: true },
"L7": { iso2: "CI", name: "Cote d'Ivoire", status: "current", inhabited: true },
"1M": { iso2: "HR", name: "Croatia", status: "current", inhabited: true },
"G3": { iso2: "CU", name: "Cuba", status: "current", inhabited: true },
"G4": { iso2: "CY", name: "Cyprus", status: "current", inhabited: true },
"2N": { iso2: "CZ", name: "Czech Republic", status: "current", inhabited: true },
"G7": { iso2: "DK", name: "Denmark", status: "current", inhabited: true },
"1G": { iso2: "DJ", name: "Djibouti", status: "current", inhabited: true },
"G9": { iso2: "DM", name: "Dominica", status: "current", inhabited: true },
"G8": { iso2: "DO", name: "Dominican Republic", status: "current", inhabited: true },
"H1": { iso2: "EC", name: "Ecuador", status: "current", inhabited: true },
"H2": { iso2: "EG", name: "Egypt", status: "current", inhabited: true },
"H3": { iso2: "SV", name: "El Salvador", status: "current", inhabited: true },
"H4": { iso2: "GQ", name: "Equatorial Guinea", status: "current", inhabited: true },
"1J": { iso2: "ER", name: "Eritrea", status: "current", inhabited: true },
"1H": { iso2: "EE", name: "Estonia", status: "current", inhabited: true },
"H5": { iso2: "ET", name: "Ethiopia", status: "current", inhabited: true },
"H7": { iso2: "FK", name: "Falkland Islands", status: "current", inhabited: true },
"H6": { iso2: "FO", name: "Faroe Islands", status: "current", inhabited: true },
"H8": { iso2: "FJ", name: "Fiji", status: "current", inhabited: true },
"H9": { iso2: "FI", name: "Finland", status: "current", inhabited: true },
"I0": { iso2: "FR", name: "France", status: "current", inhabited: true },
"I3": { iso2: "GF", name: "French Guiana", status: "current", inhabited: true },
"I4": { iso2: "PF", name: "French Polynesia", status: "current", inhabited: true },
"2C": { iso2: "TF", name: "French Southern Territories", status: "current", inhabited: false },
"I5": { iso2: "GA", name: "Gabon", status: "current", inhabited: true },
"I6": { iso2: "GM", name: "Gambia", status: "current", inhabited: true },
"2Q": { iso2: "GE", name: "Georgia (country)", status: "current", inhabited: true },
"2M": { iso2: "DE", name: "Germany", status: "current", inhabited: true },
"J0": { iso2: "GH", name: "Ghana", status: "current", inhabited: true },
"J1": { iso2: "GI", name: "Gibraltar", status: "current", inhabited: true },
"J3": { iso2: "GR", name: "Greece", status: "current", inhabited: true },
"J4": { iso2: "GL", name: "Greenland", status: "current", inhabited: true },
"J5": { iso2: "GD", name: "Grenada", status: "current", inhabited: true },
"J6": { iso2: "GP", name: "Guadeloupe", status: "current", inhabited: true },
"GU": { iso2: "GU", name: "Guam", status: "current", inhabited: true },
"J8": { iso2: "GT", name: "Guatemala", status: "current", inhabited: true },
"Y7": { iso2: "GG", name: "Guernsey", status: "current", inhabited: true },
"J9": { iso2: "GN", name: "Guinea", status: "current", inhabited: true },
"S0": { iso2: "GW", name: "Guinea-Bissau", status: "current", inhabited: true },
"K0": { iso2: "GY", name: "Guyana", status: "current", inhabited: true },
"K1": { iso2: "HT", name: "Haiti", status: "current", inhabited: true },
"K4": { iso2: "HM", name: "Heard Island and McDonald Islands", status: "current", inhabited: false },
"X4": { iso2: "VA", name: "Vatican City", status: "current", inhabited: true },
"K2": { iso2: "HN", name: "Honduras", status: "current", inhabited: true },
"K3": { iso2: "HK", name: "Hong Kong", status: "current", inhabited: true },
"K5": { iso2: "HU", name: "Hungary", status: "current", inhabited: true },
"K6": { iso2: "IS", name: "Iceland", status: "current", inhabited: true },
"K7": { iso2: "IN", name: "India", status: "current", inhabited: true },
"K8": { iso2: "ID", name: "Indonesia", status: "current", inhabited: true },
"K9": { iso2: "IR", name: "Iran", status: "current", inhabited: true },
"L0": { iso2: "IQ", name: "Iraq", status: "current", inhabited: true },
"L2": { iso2: "IE", name: "Ireland", status: "current", inhabited: true },
"Y8": { iso2: "IM", name: "Isle of Man", status: "current", inhabited: true },
"L3": { iso2: "IL", name: "Israel", status: "current", inhabited: true },
"L6": { iso2: "IT", name: "Italy", status: "current", inhabited: true },
"L8": { iso2: "JM", name: "Jamaica", status: "current", inhabited: true },
"M0": { iso2: "JP", name: "Japan", status: "current", inhabited: true },
"Y9": { iso2: "JE", name: "Jersey", status: "current", inhabited: true },
"M2": { iso2: "JO", name: "Jordan", status: "current", inhabited: true },
"1P": { iso2: "KZ", name: "Kazakhstan", status: "current", inhabited: true },
"M3": { iso2: "KE", name: "Kenya", status: "current", inhabited: true },
"J2": { iso2: "KI", name: "Kiribati", status: "current", inhabited: true },
"M4": { iso2: "KP", name: "North Korea", status: "current", inhabited: true },
"M5": { iso2: "KR", name: "South Korea", status: "current", inhabited: true },
"M6": { iso2: "KW", name: "Kuwait", status: "current", inhabited: true },
"1N": { iso2: "KG", name: "Kyrgyzstan", status: "current", inhabited: true },
"M7": { iso2: "LA", name: "Laos", status: "current", inhabited: true },
"1R": { iso2: "LV", name: "Latvia", status: "current", inhabited: true },
"M8": { iso2: "LB", name: "Lebanon", status: "current", inhabited: true },
"M9": { iso2: "LS", name: "Lesotho", status: "current", inhabited: true },
"N0": { iso2: "LR", name: "Liberia", status: "current", inhabited: true },
"N1": { iso2: "LY", name: "Libya", status: "current", inhabited: true },
"N2": { iso2: "LI", name: "Liechtenstein", status: "current", inhabited: true },
"1Q": { iso2: "LT", name: "Lithuania", status: "current", inhabited: true },
"N4": { iso2: "LU", name: "Luxembourg", status: "current", inhabited: true },
"N5": { iso2: "MO", name: "Macau", status: "current", inhabited: true },
"1U": { iso2: "MK", name: "North Macedonia", status: "current", inhabited: true },
"N6": { iso2: "MG", name: "Madagascar", status: "current", inhabited: true },
"N7": { iso2: "MW", name: "Malawi", status: "current", inhabited: true },
"N8": { iso2: "MY", name: "Malaysia", status: "current", inhabited: true },
"N9": { iso2: "MV", name: "Maldives", status: "current", inhabited: true },
"O0": { iso2: "ML", name: "Mali", status: "current", inhabited: true },
"O1": { iso2: "MT", name: "Malta", status: "current", inhabited: true },
"1T": { iso2: "MH", name: "Marshall Islands", status: "current", inhabited: true },
"O2": { iso2: "MQ", name: "Martinique", status: "current", inhabited: true },
"O3": { iso2: "MR", name: "Mauritania", status: "current", inhabited: true },
"O4": { iso2: "MU", name: "Mauritius", status: "current", inhabited: true },
"2P": { iso2: "YT", name: "Mayotte", status: "current", inhabited: true },
"O5": { iso2: "MX", name: "Mexico", status: "current", inhabited: true },
"1K": { iso2: "FM", name: "Micronesia", status: "current", inhabited: true },
"1S": { iso2: "MD", name: "Moldova", status: "current", inhabited: true },
"O9": { iso2: "MC", name: "Monaco", status: "current", inhabited: true },
"P0": { iso2: "MN", name: "Mongolia", status: "current", inhabited: true },
"Z5": { iso2: "ME", name: "Montenegro", status: "current", inhabited: true },
"P1": { iso2: "MS", name: "Montserrat", status: "current", inhabited: true },
"P2": { iso2: "MA", name: "Morocco", status: "current", inhabited: true },
"P3": { iso2: "MZ", name: "Mozambique", status: "current", inhabited: true },
"E1": { iso2: "MM", name: "Myanmar", status: "current", inhabited: true },
"T6": { iso2: "NA", name: "Namibia", status: "current", inhabited: true },
"P5": { iso2: "NR", name: "Nauru", status: "current", inhabited: true },
"P6": { iso2: "NP", name: "Nepal", status: "current", inhabited: true },
"P7": { iso2: "NL", name: "Netherlands", status: "current", inhabited: true },
"P8": { iso2: null, name: "Netherlands Antilles (dissolved 2010)", status: "obsolete", inhabited: true },
"1W": { iso2: "NC", name: "New Caledonia", status: "current", inhabited: true },
"Q2": { iso2: "NZ", name: "New Zealand", status: "current", inhabited: true },
"Q3": { iso2: "NI", name: "Nicaragua", status: "current", inhabited: true },
"Q4": { iso2: "NE", name: "Niger", status: "current", inhabited: true },
"Q5": { iso2: "NG", name: "Nigeria", status: "current", inhabited: true },
"Q6": { iso2: "NU", name: "Niue", status: "current", inhabited: true },
"Q7": { iso2: "NF", name: "Norfolk Island", status: "current", inhabited: true },
"1V": { iso2: "MP", name: "Northern Mariana Islands", status: "current", inhabited: true },
"Q8": { iso2: "NO", name: "Norway", status: "current", inhabited: true },
"P4": { iso2: "OM", name: "Oman", status: "current", inhabited: true },
"R0": { iso2: "PK", name: "Pakistan", status: "current", inhabited: true },
"1Y": { iso2: "PW", name: "Palau", status: "current", inhabited: true },
"1X": { iso2: "PS", name: "Palestine", status: "current", inhabited: true },
"R1": { iso2: "PA", name: "Panama", status: "current", inhabited: true },
"R2": { iso2: "PG", name: "Papua New Guinea", status: "current", inhabited: true },
"R4": { iso2: "PY", name: "Paraguay", status: "current", inhabited: true },
"R5": { iso2: "PE", name: "Peru", status: "current", inhabited: true },
"R6": { iso2: "PH", name: "Philippines", status: "current", inhabited: true },
"R8": { iso2: "PN", name: "Pitcairn Islands", status: "current", inhabited: true },
"R9": { iso2: "PL", name: "Poland", status: "current", inhabited: true },
"S1": { iso2: "PT", name: "Portugal", status: "current", inhabited: true },
"PR": { iso2: "PR", name: "Puerto Rico", status: "current", inhabited: true },
"S3": { iso2: "QA", name: "Qatar", status: "current", inhabited: true },
"S4": { iso2: "RE", name: "Reunion", status: "current", inhabited: true },
"S5": { iso2: "RO", name: "Romania", status: "current", inhabited: true },
"1Z": { iso2: "RU", name: "Russia", status: "current", inhabited: true },
"S6": { iso2: "RW", name: "Rwanda", status: "current", inhabited: true },
"Z0": { iso2: "BL", name: "Saint Barthelemy", status: "current", inhabited: true },
"U8": { iso2: "SH", name: "Saint Helena", status: "current", inhabited: true },
"U7": { iso2: "KN", name: "Saint Kitts and Nevis", status: "current", inhabited: true },
"U9": { iso2: "LC", name: "Saint Lucia", status: "current", inhabited: true },
"Z1": { iso2: "MF", name: "Saint Martin", status: "current", inhabited: true },
"V0": { iso2: "PM", name: "Saint Pierre and Miquelon", status: "current", inhabited: true },
"V1": { iso2: "VC", name: "Saint Vincent and the Grenadines", status: "current", inhabited: true },
"Y0": { iso2: "WS", name: "Samoa", status: "current", inhabited: true },
"S8": { iso2: "SM", name: "San Marino", status: "current", inhabited: true },
"S9": { iso2: "ST", name: "Sao Tome and Principe", status: "current", inhabited: true },
"T0": { iso2: "SA", name: "Saudi Arabia", status: "current", inhabited: true },
"T1": { iso2: "SN", name: "Senegal", status: "current", inhabited: true },
"Z2": { iso2: "RS", name: "Serbia", status: "current", inhabited: true },
"T2": { iso2: "SC", name: "Seychelles", status: "current", inhabited: true },
"T8": { iso2: "SL", name: "Sierra Leone", status: "current", inhabited: true },
"U0": { iso2: "SG", name: "Singapore", status: "current", inhabited: true },
"2B": { iso2: "SK", name: "Slovakia", status: "current", inhabited: true },
"2A": { iso2: "SI", name: "Slovenia", status: "current", inhabited: true },
"D7": { iso2: "SB", name: "Solomon Islands", status: "current", inhabited: true },
"U1": { iso2: "SO", name: "Somalia", status: "current", inhabited: true },
"T3": { iso2: "ZA", name: "South Africa", status: "current", inhabited: true },
"1L": { iso2: "GS", name: "South Georgia and the South Sandwich Islands", status: "current", inhabited: false },
"U3": { iso2: "ES", name: "Spain", status: "current", inhabited: true },
"F1": { iso2: "LK", name: "Sri Lanka", status: "current", inhabited: true },
"V2": { iso2: "SD", name: "Sudan", status: "current", inhabited: true },
"V3": { iso2: "SR", name: "Suriname", status: "current", inhabited: true },
"L9": { iso2: "SJ", name: "Svalbard and Jan Mayen", status: "current", inhabited: true },
"V6": { iso2: "SZ", name: "Eswatini", status: "current", inhabited: true },
"V7": { iso2: "SE", name: "Sweden", status: "current", inhabited: true },
"V8": { iso2: "CH", name: "Switzerland", status: "current", inhabited: true },
"V9": { iso2: "SY", name: "Syria", status: "current", inhabited: true },
"F5": { iso2: "TW", name: "Taiwan", status: "current", inhabited: true },
"2D": { iso2: "TJ", name: "Tajikistan", status: "current", inhabited: true },
"W0": { iso2: "TZ", name: "Tanzania", status: "current", inhabited: true },
"W1": { iso2: "TH", name: "Thailand", status: "current", inhabited: true },
"Z3": { iso2: "TL", name: "Timor-Leste", status: "current", inhabited: true },
"W2": { iso2: "TG", name: "Togo", status: "current", inhabited: true },
"W3": { iso2: "TK", name: "Tokelau", status: "current", inhabited: true },
"W4": { iso2: "TO", name: "Tonga", status: "current", inhabited: true },
"W5": { iso2: "TT", name: "Trinidad and Tobago", status: "current", inhabited: true },
"W6": { iso2: "TN", name: "Tunisia", status: "current", inhabited: true },
"W8": { iso2: "TR", name: "Turkey", status: "current", inhabited: true },
"2E": { iso2: "TM", name: "Turkmenistan", status: "current", inhabited: true },
"W7": { iso2: "TC", name: "Turks and Caicos Islands", status: "current", inhabited: true },
"2G": { iso2: "TV", name: "Tuvalu", status: "current", inhabited: true },
"W9": { iso2: "UG", name: "Uganda", status: "current", inhabited: true },
"2H": { iso2: "UA", name: "Ukraine", status: "current", inhabited: true },
"C0": { iso2: "AE", name: "United Arab Emirates", status: "current", inhabited: true },
"X0": { iso2: "GB", name: "United Kingdom", status: "current", inhabited: true },
"2J": { iso2: "UM", name: "United States Minor Outlying Islands", status: "current", inhabited: false },
"X3": { iso2: "UY", name: "Uruguay", status: "current", inhabited: true },
"2K": { iso2: "UZ", name: "Uzbekistan", status: "current", inhabited: true },
"2L": { iso2: "VU", name: "Vanuatu", status: "current", inhabited: true },
"X5": { iso2: "VE", name: "Venezuela", status: "current", inhabited: true },
"Q1": { iso2: "VN", name: "Vietnam", status: "current", inhabited: true },
"D8": { iso2: "VG", name: "British Virgin Islands", status: "current", inhabited: true },
"VI": { iso2: "VI", name: "U.S. Virgin Islands", status: "current", inhabited: true },
"X8": { iso2: "WF", name: "Wallis and Futuna", status: "current", inhabited: true },
"U5": { iso2: "EH", name: "Western Sahara", status: "current", inhabited: true },
"T7": { iso2: "YE", name: "Yemen", status: "current", inhabited: true },
"Y4": { iso2: "ZM", name: "Zambia", status: "current", inhabited: true },
"Y5": { iso2: "ZW", name: "Zimbabwe", status: "current", inhabited: true },
"C2": { iso2: null, name: "Ashmore and Cartier Islands (Australia)", status: "obsolete", inhabited: false },
"E5": { iso2: "PA", name: "Panama Canal Zone", status: "obsolete", inhabited: true },
"E6": { iso2: "CA", name: "Montreal, Canada", status: "obsolete", inhabited: true },
"E7": { iso2: "KI", name: "Canton and Enderbury Islands (Kiribati)", status: "obsolete", inhabited: false },
"G5": { iso2: null, name: "Czechoslovakia", status: "obsolete", inhabited: true },
"I7": { iso2: "PS", name: "Gaza Strip (Palestine)", status: "obsolete", inhabited: true },
"I8": { iso2: "DE", name: "West Germany", status: "obsolete", inhabited: true },
"I9": { iso2: "DE", name: "Germany, Federal Republic", status: "obsolete", inhabited: true },
"L1": { iso2: null, name: "Iraq-Saudi Arabia Neutral Zone", status: "obsolete", inhabited: false },
"L4": { iso2: null, name: "Israel-Jordan zone", status: "obsolete", inhabited: false },
"L5": { iso2: null, name: "Israel-Syria zone", status: "obsolete", inhabited: false },
"M1": { iso2: "UM", name: "Johnston Atoll", status: "obsolete", inhabited: false },
"O6": { iso2: "UM", name: "Midway Islands", status: "obsolete", inhabited: false },
"Q9": { iso2: null, name: "Trust Territory of the Pacific Islands", status: "obsolete", inhabited: true },
"R3": { iso2: null, name: "Paracel Islands", status: "obsolete", inhabited: false },
"T4": { iso2: "ZW", name: "Southern Rhodesia (Zimbabwe)", status: "obsolete", inhabited: true },
"U2": { iso2: null, name: "Soviet Union", status: "obsolete", inhabited: true },
"U4": { iso2: "ES", name: "Spanish North Africa (Ceuta and Melilla)", status: "obsolete", inhabited: true },
"U6": { iso2: null, name: "Spratly Islands", status: "obsolete", inhabited: false },
"Y2": { iso2: null, name: "Yugoslavia", status: "obsolete", inhabited: true },
"2F": { iso2: "TL", name: "East Timor (now Timor-Leste, code Z3)", status: "obsolete", inhabited: true },
};
/** Resolve an EDGAR State-or-Country code to an ISO alpha-2 code (uppercase), or null. */
export function secCodeToIso(code) {
const entry = secCountryCodes[code.trim().toUpperCase()];
return entry ? entry.iso2 : null;
}
//# sourceMappingURL=sec-countries.js.map