本文へ移動

address-plusアドレスプラス

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

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

目次

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

AustralianAddressFields型

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

The fields an Australian address fills beside the shared ones. The shared fields keep their meaning: number is the street number, street and type the street's name and its type (Australia Post's abbreviation, St, Pde, Cres), secUnitType and secUnitNum the unit (Unit 3) or the postal delivery (PO Box 37, Locked Bag 801), city the suburb or town, state the state's code and zip the postcode.

インポート

import type { AustralianAddressFields } from "@johnmorrisdotca/address-plus/au";

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

定義

interface AustralianAddressFields {
    floorType?: string;
    lot?: string;
}

メンバー

名前型説明
floorType (省略可)string | undefined
lot (省略可)string | undefined

例

import { parseAustralianAddress } from "@johnmorrisdotca/address-plus/au";
import type { AustralianAddressFields } from "@johnmorrisdotca/address-plus/au";

console.log(parseAustralianAddress("Level 6, 51 Jacobson St, Brisbane QLD 4000")?.floorType);
// → "Level"
Level

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

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

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