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

AustralianPostcodeRangetype

One block of postcodes Australia Post allocates to a state or territory: every postcode from from to to, inclusive, written as four digits.

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

interface AustralianPostcodeRange {
    state: AustralianStateCode;
    from: string;
    to: string;
    use: "delivery" | "po-box";
}

Members

NameTypeDescription
stateAustralianStateCode
fromstring
tostring
use"delivery" | "po-box"

Examples

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

console.log(AU_POSTCODE_RANGES.find((range) => range.state === "TAS"));
// → {"state":"TAS","from":"7000","to":"7999","use":"delivery"}
{ state: 'TAS', from: '7000', to: '7999', use: 'delivery' }

What it prints (run when this page was built)

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