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

AustralianStatetype

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).

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

interface AustralianState {
    code: AustralianStateCode;
    iso: string;
    name: string;
    nameJa: string;
    kind: "state" | "territory";
}

Members

NameTypeDescription
codeAustralianStateCode
isostring
namestring
nameJastring
kind"state" | "territory"

Examples

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

console.log(findAustralianState("Victoria"));
// → {"code":"VIC","iso":"AU-VIC","name":"Victoria","nameJa":"ビクトリア州","kind":"state"}
{
  code: 'VIC',
  iso: 'AU-VIC',
  name: 'Victoria',
  nameJa: 'ビクトリア州',
  kind: 'state'
}

What it prints (run when this page was built)

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