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

findAustralianStatefunction

Finds an Australian state or territory by its code (VIC, AU-VIC, Vic.) or its name in English or Japanese (Victoria, ビクトリア州), in any letter case.

Import it

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

Definition

function findAustralianState(text: string): AustralianState | null

Parameters

NameTypeDescription
textstring

The code or the name.

Returns

AustralianState | null

The state, or null when nothing matches.

Examples

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

console.log(findAustralianState("n.s.w.")?.name);
// → "New South Wales"
New South Wales

What it prints (run when this page was built)

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