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

findMunicipalitiesByRomajifunction

The municipalities a romaji name could mean, written with or without macrons and designators (Chiyoda-ku, Chiyoda City, Sapporo-shi Chuo-ku, Chuo-ku, Sapporo). A town written without its district, and then a ward written without its city, are looked up when the full name finds nothing.

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

function findMunicipalitiesByRomaji(text: string, prefectureCode?: string): JapaneseMunicipality[]

Parameters

NameTypeDescription
textstring

The name in romaji.

prefectureCode (optional)string | undefined

A prefecture's JIS code, to look in that prefecture only.

Returns

JapaneseMunicipality[]

Every match, an empty array when there is none.

Examples

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

console.log(findMunicipalitiesByRomaji("Chuo-ku, Sapporo").map((one) => one.name));
// → ["札幌市中央区"]
[ '札幌市中央区' ]

What it prints (run when this page was built)

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