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 · /nz

findNewZealandRegionfunction

Finds a region of New Zealand by its code (AUK, NZ-AUK) or its name in English, ignoring macrons, hyphens and letter case.

Import it

import { findNewZealandRegion } from "@johnmorrisdotca/address-plus/nz";

Definition

function findNewZealandRegion(query: string): PostcodeRegion | undefined

Parameters

NameTypeDescription
querystring

The region's code or name.

Returns

PostcodeRegion | undefined

The region, or undefined when none has that code or name.

Examples

import { findNewZealandRegion } from "@johnmorrisdotca/address-plus/nz";

console.log([findNewZealandRegion("auk")?.name, findNewZealandRegion("Hawke's Bay")?.code, findNewZealandRegion("x")]);
// → ["Auckland","HKB",null]
[ 'Auckland', 'HKB', undefined ]

What it prints (run when this page was built)

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