normalizeRegion関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Finds the US state or Canadian province a name, code or misspelling means: Calfornia, Que., British Columbia,
nfld.
インポート
import { normalizeRegion } from "@johnmorrisdotca/address-plus";
定義
function normalizeRegion(input: string): { abbr: string; country: "CA" | "US"; } | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
input | string | A state or province name, code or abbreviation, in English or French. |
戻り値
{ abbr: string; country: "CA" | "US"; } | null
Its code and country, or null when nothing is close enough.
例
import { normalizeRegion } from "@johnmorrisdotca/address-plus";
console.log(normalizeRegion("Calfornia"));
// → {"abbr":"CA","country":"US"}{ abbr: 'CA', country: 'US' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。