JapaneseAddressFields型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The fields a Japanese address fills on top of the shared ones. Every value is normalised: full-width and kanji numerals become ASCII digits, and the block is split into chome, ban and go whichever way it was written.
インポート
import type { JapaneseAddressFields } from "@johnmorrisdotca/address-plus/jp";
ほかのエクスポート元: @johnmorrisdotca/address-plus
定義
interface JapaneseAddressFields {
postalCode?: string;
prefecture?: string;
prefectureCode?: string;
prefectureRomaji?: string;
municipality?: string;
municipalityCode?: string;
municipalityRomaji?: string;
streetDirections?: string;
town?: string;
chome?: string;
ban?: string;
go?: string;
block?: string;
building?: string;
floor?: string;
room?: string;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
postalCode (省略可) | string | undefined | |
prefecture (省略可) | string | undefined | |
prefectureCode (省略可) | string | undefined | |
prefectureRomaji (省略可) | string | undefined | |
municipality (省略可) | string | undefined | |
municipalityCode (省略可) | string | undefined | |
municipalityRomaji (省略可) | string | undefined | |
streetDirections (省略可) | string | undefined | |
town (省略可) | string | undefined | |
chome (省略可) | string | undefined | |
ban (省略可) | string | undefined | |
go (省略可) | string | undefined | |
block (省略可) | string | undefined | |
building (省略可) | string | undefined | |
floor (省略可) | string | undefined | |
room (省略可) | string | undefined |
例
import { parseLocation } from "@johnmorrisdotca/address-plus";
import type { JapaneseAddressFields } from "@johnmorrisdotca/address-plus/jp";
console.log(parseLocation("〒100-0005 東京都千代田区丸の内1丁目2番3号")?.municipalityCode);
// → "13101"13101出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。