parseNewZealandPostcodefunction
Takes a postcode apart: the region it is in, and whether GeoNames' list has it.
Import it
import { parseNewZealandPostcode } from "@johnmorrisdotca/address-plus/nz";
Definition
function parseNewZealandPostcode(postcode: string): PostcodeLookup
Parameters
| Name | Type | Description |
|---|---|---|
postcode | string | The postcode. |
Returns
PostcodeLookup
The postcode, its region (when the list gives one) and whether the list has it.
Examples
import { parseNewZealandPostcode } from "@johnmorrisdotca/address-plus/nz";
console.log(parseNewZealandPostcode("1010"));
// → {"postcode":"1010","region":"AUK","known":true}{ postcode: '1010', region: 'AUK', known: true }What it prints (run when this page was built)