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
| Name | Type | Description |
|---|---|---|
state | string | 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)