Reference · Japanese addresses
parseJapaneseAddressfunction
Parses a Japanese address, in Japanese script or in romaji, into the Japanese fields and the shared ones.
parseLocation calls it for any address that looks Japanese; call it directly to skip the detection.
Import it
import { parseJapaneseAddress } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
function parseJapaneseAddress(text: string, options?: ParseOptions): ParsedAddress | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The address as one string, in either script, with or without 〒 and the postal code. |
options (optional) | ParseOptions |
|
Returns
ParsedAddress | null
The parts found, or null when nothing in the text names a place in Japan (no prefecture, municipality or
postal code).
Examples
import { parseJapaneseAddress } from "@johnmorrisdotca/address-plus/jp";
console.log(parseJapaneseAddress("〒100-0005 東京都千代田区丸の内1丁目2番3号 サンプルビル5階501号室")?.block);
// → "1-2-3"1-2-3What it prints (run when this page was built)