リファレンス
/kr
import { … } from "@johnmorrisdotca/address-plus/kr";
最小化と gzip 圧縮をしたサイズは 7.9 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
compareKoreanAddresses | 関数 | 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 | 型 | 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 | 型 | 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 | 型 | A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer. |
CountryValidation | 型 | What a country module's validator returns: the errors and the warnings it found. |
findKoreanProvince | 関数 | 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 | 関数 | Writes an address in South Korea as Korea Post asks. |
FormattedAddress | 型 | A formatted address: its lines, and the same on one line. |
getProvinceFromKoreanPostcode | 関数 | The province or metropolitan city a postcode is in, by its ISO 3166-2 code without KR- (11 for Seoul). |
isKnownKoreanPostcode | 関数 | Whether GeoNames' list for South Korea has a postcode (34,249 of them). |
isValidKoreanPostcode | 関数 | Whether a postcode follows Korea Post's shape: five digits. |
KoreaPostFormattingOptions | 型 | Options for formatKoreaPost. |
KR_PROVINCES | 定数 | The metropolitan cities and provinces of South Korea. |
looksKorean | 関数 | 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 | 型 | What parseLocation returns: every part it found, each absent when the address has none. |
parseKoreanAddress | 関数 | 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 | 関数 | Takes a postcode apart: the province it is in, and whether GeoNames' list has it. |
ParseOptions | 型 | Options for every parser: the country, strict postal codes, snake_case keys and the rest. |
PostcodeLookup | 型 | 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 | 型 | 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 | 定数 | 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 | 関数 | 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 | 型 | One finding of a validator: the field it is about, its code, a message, and how serious it is. |
ValidationOptions | 型 | 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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。