getDepartmentFromFrenchPostcode関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The department a postcode's number belongs to, by its code: 75 for 75008, 2B for 20200, 971 for 97100.
インポート
import { getDepartmentFromFrenchPostcode } from "@johnmorrisdotca/address-plus/fr";
定義
function getDepartmentFromFrenchPostcode(postcode: string): string | undefined
引数
| 名前 | 型 | 説明 |
|---|---|---|
postcode | string | The postcode. |
戻り値
string | undefined
The department's code; undefined for a postcode in a collectivity or Monaco, one that no department
has, or text that is not a postcode.
例
import { getDepartmentFromFrenchPostcode } from "@johnmorrisdotca/address-plus/fr";
console.log(["75008", "20190", "20200", "97400", "98714", "98000"].map(getDepartmentFromFrenchPostcode));
// → ["75","2A","2B","974",null,null][ '75', '2A', '2B', '974', undefined, undefined ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。