parseAustralianAddress関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Parses an Australian address into its parts, as Australia Post lays one out: the delivery line, then the suburb or
town, the state and the postcode. Reads a unit written 3/12, Unit 3/12, Unit 3, 12 or U3 12; a level
(Level 6, L6, Ground Floor); a lot (Lot 12); a range of numbers (12-14); a building's name on a line of
its own; and the postal deliveries PO Box, GPO Box, Locked Bag, Private Bag, RMB, RSD, RMS, CMB,
CMA, CPA, MS and Care PO. The street type is reported as AS4590's abbreviation (St, Pde, Cres). A state
is written by its code or its name; a trailing Australia is dropped.
インポート
import { parseAustralianAddress } from "@johnmorrisdotca/address-plus/au";
定義
function parseAustralianAddress(text: string, options?: ParseOptions): ParsedAddress | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | The address as one string; commas and line breaks both separate its parts. |
options (省略可) | ParseOptions |
|
戻り値
ParsedAddress | null
The parts found, with country: "AU", or null when the text is empty or has nothing but a state.
例
import { parseAustralianAddress } from "@johnmorrisdotca/address-plus/au";
console.log(parseAustralianAddress("Unit 3/12 Smith St, Parramatta NSW 2150"));
// → {"secUnitType":"Unit","secUnitNum":"3","number":"12","street":"Smith","type":"St","city":"Parramatta","state":"NSW","zip":"2150","zipValid":true,"country":"AU"}{
secUnitType: 'Unit',
secUnitNum: '3',
number: '12',
street: 'Smith',
type: 'St',
city: 'Parramatta',
state: 'NSW',
zip: '2150',
zipValid: true,
country: 'AU'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。