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

normalizeJapaneseAddressTextfunction

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. The postal mark 〒 is kept.

Import it

import { normalizeJapaneseAddressText } from "@johnmorrisdotca/address-plus/jp";

Also exported from: @johnmorrisdotca/address-plus

Definition

function normalizeJapaneseAddressText(text: string): string

Parameters

NameTypeDescription
textstring

Japanese text.

Returns

string

The text made uniform.

Examples

import { normalizeJapaneseAddressText } from "@johnmorrisdotca/address-plus/jp";

console.log(normalizeJapaneseAddressText("〒100-0005 東京都千代田区丸の内一丁目二番三号"));
// → "〒100-0005 東京都千代田区丸の内1丁目2番3号"
〒100-0005 東京都千代田区丸の内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.