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

getPostcodeRangesForAustralianStatefunction

The blocks of postcodes Australia Post allocates to a state or territory.

Import it

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

Definition

function getPostcodeRangesForAustralianState(state: string): AustralianPostcodeRange[]

Parameters

NameTypeDescription
statestring

The state's code or name.

Returns

AustralianPostcodeRange[]

The blocks, in order; an empty array for something that is not a state.

Examples

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

console.log(getPostcodeRangesForAustralianState("Victoria").map((range) => `${range.from}-${range.to}`));
// → ["3000-3999","8000-8999"]
[ '3000-3999', '8000-8999' ]

What it prints (run when this page was built)

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