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

AustralianStateCodetype

The code of an Australian state or territory, as Australia Post writes it on the last line of an address.

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

type AustralianStateCode = "ACT" | "NSW" | "NT" | "QLD" | "SA" | "TAS" | "VIC" | "WA";

Examples

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

console.log(getStateFromAustralianPostcode("3000"));
// → "VIC"
VIC

What it prints (run when this page was built)

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