Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

Reference · Australian country module

looksAustralianfunction

Whether an address is surely Australian, with no hint: it ends with Australia, or with a state and an Australian postcode (NSW 2150, Victoria 3000, VIC 2000, whose postcode is Sydney's). WA needs one of Western Australia's postcodes (WA 6000), since WA 9810 is a Washington ZIP code cut short. A postcode alone is not enough: four digits end addresses in many countries.

Import it

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

Definition

function looksAustralian(text: string): boolean

Parameters

NameTypeDescription
textstring

The address as one string.

Returns

boolean

true when the address is Australian beyond doubt, false otherwise.

Examples

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

console.log([looksAustralian("12 Smith St, Parramatta NSW 2150"), looksAustralian("123 Main St, Seattle, WA 9810")]);
// → [true,false]
[ true, false ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.7.0.