Reference
/kr
import { … } from "@johnmorrisdotca/address-plus/kr";
7.9 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
compareKoreanAddresses | function | Compares two addresses in South Korea field by field: the province, the district, the road and its number, the dong, the floor, the unit and the postcode. |
CountryComparison | type | What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated). |
CountryDifference | type | One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form. |
CountryModule | type | A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer. |
CountryValidation | type | What a country module's validator returns: the errors and the warnings it found. |
findKoreanProvince | function | Finds a province or metropolitan city of South Korea by its code (11, KR-11), its name in English (Seoul, Gyeonggi-do) or its name in Korean (서울특별시, 서울), ignoring letter case, spaces and hyphens. |
formatKoreaPost | function | Writes an address in South Korea as Korea Post asks. |
FormattedAddress | type | A formatted address: its lines, and the same on one line. |
getProvinceFromKoreanPostcode | function | The province or metropolitan city a postcode is in, by its ISO 3166-2 code without KR- (11 for Seoul). |
isKnownKoreanPostcode | function | Whether GeoNames' list for South Korea has a postcode (34,249 of them). |
isValidKoreanPostcode | function | Whether a postcode follows Korea Post's shape: five digits. |
KoreaPostFormattingOptions | type | Options for formatKoreaPost. |
KR_PROVINCES | constant | The metropolitan cities and provinces of South Korea. |
looksKorean | function | Whether an address is surely Korean, with no hint: it ends with South Korea, Korea or 대한민국, or it is written in Hangul with the name of a metropolitan city or province, or a road and its number, or it is written in Latin letters with a road (-ro, -daero, -gil), a province's name and a postcode the list has before the end. |
ParsedAddress | type | What parseLocation returns: every part it found, each absent when the address has none. |
parseKoreanAddress | function | Parses an address in South Korea, written in Hangul from the province down (서울특별시 중구 세종대로 110 (태평로1가)) or in Latin letters from the number up (110 Sejong-daero, Jung-gu, Seoul 04524). |
parseKoreanPostcode | function | Takes a postcode apart: the province it is in, and whether GeoNames' list has it. |
ParseOptions | type | Options for every parser: the country, strict postal codes, snake_case keys and the rest. |
PostcodeLookup | type | A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it. |
PostcodeRegion | type | A region a postcode can be in, as a country's table holds it: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata). |
southKorea | constant | South Korea's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with South Korea, Korea or 대한민국, or is written in Hangul with a province's name or a road and its number, is read as Korean; country: "KR" reads any address as one. |
validateKoreanAddress | function | Checks an address in South Korea: the postcode is five digits and GeoNames' list has it, the province written agrees with the postcode's, and the road's building number and the district are given. |
ValidationError | type | One finding of a validator: the field it is about, its code, a message, and how serious it is. |
ValidationOptions | type | Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error. |