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

PostcodeLookuptype

A postcode taken apart: its canonical form, the region it is in (when the country's table has regions), and whether the country's list has it.

Import it

import type { PostcodeLookup } from "@johnmorrisdotca/address-plus/nl";

Also exported from: @johnmorrisdotca/address-plus/es, @johnmorrisdotca/address-plus/it, @johnmorrisdotca/address-plus/nz, @johnmorrisdotca/address-plus/in, @johnmorrisdotca/address-plus/kr, @johnmorrisdotca/address-plus/br, @johnmorrisdotca/address-plus

Definition

interface PostcodeLookup {
    postcode: string;
    region?: string;
    known: boolean;
}

Members

NameTypeDescription
postcodestring
region (optional)string | undefined
knownboolean

Examples

import { parseSpanishPostcode } from "@johnmorrisdotca/address-plus/es";
import type { PostcodeLookup } from "@johnmorrisdotca/address-plus/es";

const found: PostcodeLookup = parseSpanishPostcode("28014");
console.log(found);
// → {"postcode":"28014","region":"M","known":true}
{ postcode: '28014', region: 'M', known: true }

What it prints (run when this page was built)

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