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
| Name | Type | Description |
|---|---|---|
text | string | 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"));
// → truetrueWhat it prints (run when this page was built)