Reference
Australian country module
import { … } from "@johnmorrisdotca/address-plus/au";
7.2 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
AU_CROSS_BORDER_POSTCODES | constant | The postcodes whose area lies in more than one state or territory, each with the states it lies in, the one with most of it first. |
AU_EXTERNAL_TERRITORY_POSTCODES | constant | The postcodes the Australian Bureau of Statistics places, wholly or partly, in the Other Territories: Jervis Bay, Norfolk Island, Christmas Island and the Cocos (Keeling) Islands. |
AU_POSTCODE_RANGES | constant | The blocks of postcodes Australia Post allocates to each state and territory. |
AU_STATES | constant | The six states and two territories of Australia, in order of their codes, each with Australia Post's code, the ISO 3166-2 code and its name in English and in Japanese. |
AU_STREET_TYPES | constant | Australia's street types: each AS4590 abbreviation, in proper case as the parser reports it, with the word it stands for. |
australia | constant | Australia's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with a state and its postcode (or Australia) is read as Australian; country: "AU" reads any address as one. |
AustralianAddressFields | type | The fields an Australian address fills beside the shared ones. |
AustralianPostcodeRange | type | One block of postcodes Australia Post allocates to a state or territory: every postcode from from to to, inclusive, written as four digits. |
AustralianState | type | An Australian state or territory in the tables: Australia Post's code, the ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata). |
AustralianStateCode | type | The code of an Australian state or territory, as Australia Post writes it on the last line of an address. |
AustraliaPostFormattingOptions | type | Options for formatAustraliaPost. |
compareAustralianAddresses | function | Compares two Australian addresses field by field: the unit, level, lot, number, street, suburb, state and postcode. |
CountryComparison | type | What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated). |
CountryDifference | type | One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form. |
CountryModule | type | A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer. |
CountryValidation | type | What a country module's validator returns: the errors and the warnings it found. |
expandAustralianStreetType | function | The word an AS4590 street type stands for: Pde is Parade. |
findAustralianState | function | 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. |
formatAustraliaPost | function | Writes an Australian address as Australia Post asks: the building's name, then the delivery line (unit and level before the number, the street type abbreviated), then the suburb, state and postcode, both in capitals with no punctuation. |
FormattedAddress | type | A formatted address: its lines, and the same on one line. |
getPostcodeRangesForAustralianState | function | The blocks of postcodes Australia Post allocates to a state or territory. |
getStateFromAustralianPostcode | function | The state or territory whose block of postcodes a postcode is in. |
getStatesForAustralianPostcode | function | Every state or territory a postcode serves: its block's state, and for a postcode that crosses a border, the states across it too, the one with most of the postcode's area first. |
looksAustralian | function | Whether an address is surely Australian, with no hint: it ends with Australia, or with a state and an Australian postcode (NSW 2150, Victoria 3000, VIC 2000, whose postcode is Sydney's). |
parseAustralianAddress | function | Parses an Australian address into its parts, as Australia Post lays one out: the delivery line, then the suburb or town, the state and the postcode. |
ParsedAddress | type | What parseLocation returns: every part it found, each absent when the address has none. |
ParseOptions | type | Options for every parser: the country, strict postal codes, snake_case keys and the rest. |
validateAustralianAddress | function | Checks an Australian address against Australia Post's blocks of postcodes: the postcode is four digits, some state's block holds it, and it is the state named, or one it serves across a border (from the ABS's Postal Areas). |
ValidationError | type | One finding of a validator: the field it is about, its code, a message, and how serious it is. |
ValidationOptions | type | Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error. |