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