リファレンス
日本の住所
import { … } from "@johnmorrisdotca/address-plus/jp";
最小化と gzip 圧縮をしたサイズは 60.6 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
findMunicipalitiesByName | 関数 | The municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima). |
findMunicipalitiesByRomaji | 関数 | The municipalities a romaji name could mean, written with or without macrons and designators (Chiyoda-ku, Chiyoda City, Sapporo-shi Chuo-ku, Chuo-ku, Sapporo). |
findMunicipalityByCode | 関数 | The municipality with a JIS X 0402 code, a designated city's own code included. |
findPrefecture | 関数 | The prefecture a name, reading, romaji spelling or JIS code refers to: 東京都, 東京, トウキョウト, Tokyo, Osaka Prefecture, 13. |
formatJapanese | 関数 | Writes a Japanese address in Japanese order, as an envelope is addressed: 〒100-0005, then 東京都千代田区丸の内1-2-3, then サンプルビル5階501号室. |
formatJapaneseEnglish | 関数 | Writes a Japanese address in English order, as a form from abroad expects: building, room, block, town, municipality, prefecture, postal code, Japan. |
getPostalPrefixesForPrefecture | 関数 | The three-digit postal prefixes a prefecture's codes begin with, the reverse of getPrefectureFromJapanesePostalCode. |
getPrefectureFromJapanesePostalCode | 関数 | The prefecture a Japanese postal code delivers to, from Japan Post's data: by its first three digits, and for the codes on the far side of a prefix that straddles a border, by the whole code. |
JapaneseAddressFields | 型 | The fields a Japanese address fills on top of the shared ones. |
JapaneseEnglishFormattingOptions | 型 | Options for formatJapaneseEnglish. |
JapaneseFormattingOptions | 型 | Options for formatJapanese. |
JapaneseMunicipality | 型 | A municipality (市区町村) in the tables: its JIS code, its prefecture's code, its official name with the district for a town or village in one, its reading and its romaji. |
JapanesePrefecture | 型 | A prefecture (都道府県) in the tables: its JIS code, official name, katakana reading and romaji. |
JapaneseValidation | 型 | What validateJapaneseAddress returns: the errors and the warnings found. |
JP_DESIGNATED_CITIES | 定数 | The twenty designated cities (政令指定都市) as municipalities of their own. |
JP_MUNICIPALITIES | 定数 | Every municipality (市区町村) by JIS X 0402 code, with its prefecture, official name, reading and romaji; a designated city's wards are listed, and the city itself is in JP_DESIGNATED_CITIES. |
JP_POSTAL_EXCEPTIONS | 定数 | The postal codes that deliver to another prefecture than the rest of their three-digit prefix, each to that prefecture's JIS code. |
JP_POSTAL_PREFIXES | 定数 | Each three-digit postal prefix, to the JIS code of the prefecture most of its codes deliver to. |
JP_PREFECTURES | 定数 | The 47 prefectures in JIS X 0401 order, each with its code, official name, katakana reading and romaji. |
kanjiNumeralsToDigits | 関数 | Turns the kanji numerals that stand for block, floor or room numbers into digits: 一丁目二番三号 becomes 1丁目2番3号. |
looksJapanese | 関数 | Whether a text is a Japanese address: in Japanese script, ending with Japan, or naming a prefecture beside a Japanese postal code, a romaji designator (-ku, -shi) or a municipality written with an English word (Chiyoda City). |
municipalitiesOf | 関数 | Every municipality of a prefecture, the designated cities included. |
normalizeJapaneseAddressText | 関数 | Makes the text of a Japanese address uniform, as the parser reads it: widths folded, spaces tidied, numerals as digits, and 1の2の3, 1-2-3 or any other dash written 1-2-3. |
ParsedAddress | 型 | What parseLocation returns: every part it found, each absent when the address has none. |
parseJapaneseAddress | 関数 | Parses a Japanese address, in Japanese script or in romaji, into the Japanese fields and the shared ones. |
ParseOptions | 型 | Options for every parser: the country, strict postal codes, snake_case keys and the rest. |
validateJapaneseAddress | 関数 | Checks a parsed Japanese address against the tables: the postal code's shape, whether any code begins with its first three digits, whether it delivers to the prefecture named, and whether the municipality is a real one in that prefecture. |
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。