Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

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

NameTypeDescription
textstring

The address as one string, in either script, with or without 〒 and the postal code.

options (optional)ParseOptions

useSnakeCase gives snake_case keys; the other options are ignored.

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-3

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.7.0.