Reference · Japanese addresses
JapaneseAddressFieldstype
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 it
import type { JapaneseAddressFields } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
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;
}
Members
| Name | Type | Description |
|---|---|---|
postalCode (optional) | string | undefined | |
prefecture (optional) | string | undefined | |
prefectureCode (optional) | string | undefined | |
prefectureRomaji (optional) | string | undefined | |
municipality (optional) | string | undefined | |
municipalityCode (optional) | string | undefined | |
municipalityRomaji (optional) | string | undefined | |
streetDirections (optional) | string | undefined | |
town (optional) | string | undefined | |
chome (optional) | string | undefined | |
ban (optional) | string | undefined | |
go (optional) | string | undefined | |
block (optional) | string | undefined | |
building (optional) | string | undefined | |
floor (optional) | string | undefined | |
room (optional) | string | undefined |
Examples
import { parseLocation } from "@johnmorrisdotca/address-plus";
import type { JapaneseAddressFields } from "@johnmorrisdotca/address-plus/jp";
console.log(parseLocation("〒100-0005 東京都千代田区丸の内1丁目2番3号")?.municipalityCode);
// → "13101"13101What it prints (run when this page was built)