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

findMunicipalitiesByNamefunction

The municipalities a Japanese name could mean: several when the name is shared (府中市 is in Tokyo and in Hiroshima). A town or village may be named without its district (当別町).

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

function findMunicipalitiesByName(name: string, prefectureCode?: string): JapaneseMunicipality[]

Parameters

NameTypeDescription
namestring

The municipality's name in Japanese.

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 { findMunicipalitiesByName } from "@johnmorrisdotca/address-plus/jp";

console.log(findMunicipalitiesByName("府中市").map((one) => one.code + " " + one.romaji));
// → ["13206 Fuchu-shi","34208 Fuchu-shi"]
[ '13206 Fuchu-shi', '34208 Fuchu-shi' ]

What it prints (run when this page was built)

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