本文へ移動

address-plusアドレスプラス

住所を端末の中で解析・確認・整形・比較し、国のモジュールや任意のフォームの入力欄を使えます。

address-plusは、parse-addressの使い方を広げ、型付きの結果、確認、書式、国のモジュールを加えます。 名前について(英語)

目次

リファレンス · フランスのモジュール

FrenchAddressFields型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The fields an address in France fills beside the shared ones. The shared fields keep their meaning: number is the street number, street the name of the street without its type and type the type in full (Rue; the name is de la Paix), secUnitType and secUnitNum an apartment or a door, floorType and floor a floor, building the building's or the residence's name, city the commune, state the department's code and zip the postcode.

インポート

import type { FrenchAddressFields } from "@johnmorrisdotca/address-plus/fr";

ほかのエクスポート元: @johnmorrisdotca/address-plus

定義

interface FrenchAddressFields {
    numberExtension?: string;
    staircase?: string;
    entrance?: string;
    lieuDit?: string;
    postalBoxType?: "BP" | "CS" | "TSA";
    postalBoxNum?: string;
    cedex?: string;
    arrondissement?: string;
    careOf?: string;
}

メンバー

名前型説明
numberExtension (省略可)string | undefined
staircase (省略可)string | undefined
entrance (省略可)string | undefined
lieuDit (省略可)string | undefined
postalBoxType (省略可)"BP" | "CS" | "TSA" | undefined
postalBoxNum (省略可)string | undefined
cedex (省略可)string | undefined
arrondissement (省略可)string | undefined
careOf (省略可)string | undefined

例

import { parseFrenchAddress } from "@johnmorrisdotca/address-plus/fr";
import type { FrenchAddressFields } from "@johnmorrisdotca/address-plus/fr";

console.log(parseFrenchAddress("12 bis rue de la Paix, 75002 Paris")?.numberExtension);
// → "bis"
bis

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/address-plus 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。