detectCountry関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Which country a parsed address is in, from its postal code, then its state or province.
インポート
import { detectCountry } from "@johnmorrisdotca/address-plus";
定義
function detectCountry(address: ParsedAddress): "US" | "CA" | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
address | ParsedAddress | The parsed address, or any object with its |
戻り値
"CA" | "US" | undefined
US or CA, or undefined when nothing says.
例
import { detectCountry } from "@johnmorrisdotca/address-plus";
console.log(detectCountry({ zip: "M5H 2N2" }));
// → "CA"CA出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。