Reference · Japanese addresses
findPrefecturefunction
The prefecture a name, reading, romaji spelling or JIS code refers to: 東京都, 東京, トウキョウト, Tokyo, Osaka Prefecture, 13.
Import it
import { findPrefecture } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
function findPrefecture(text: string): JapanesePrefecture | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The name, reading or code; letter case and macrons do not matter. |
Returns
JapanesePrefecture | null
The prefecture, or null when the text names none.
Examples
import { findPrefecture } from "@johnmorrisdotca/address-plus/jp";
console.log(findPrefecture("Osaka Prefecture")?.name);
// → "大阪府"大阪府What it prints (run when this page was built)