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

looksJapanesefunction

Whether a text is a Japanese address: in Japanese script, ending with Japan, or naming a prefecture beside a Japanese postal code, a romaji designator (-ku, -shi) or a municipality written with an English word (Chiyoda City). A US address that only mentions a Japanese name (100 Tokyo Ave) does not count.

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

function looksJapanese(text: string): boolean

Parameters

NameTypeDescription
textstring

The text.

Returns

boolean

true when the text should be read as Japanese.

Examples

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

console.log(looksJapanese("1-2-3 Marunouchi, Chiyoda-ku, Tokyo"));
// → true
true

What it prints (run when this page was built)

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