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

isValidDutchPostcodefunction

Whether a postcode follows PostNL's shape: four digits (the first not nought) and two letters (not beginning SA, SD or SS), with or without the space between. Whether it is in use is a different question; isKnownDutchPostcode asks it, and the validator checks both.

Import it

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

Definition

function isValidDutchPostcode(postcode: string): boolean

Parameters

NameTypeDescription
postcodestring

The postcode.

Returns

boolean

true when it has the shape.

Examples

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

console.log(["1015 CJ", "1015cj", "1015", "1015 SS", "0123 AB"].map(isValidDutchPostcode));
// → [true,true,false,false,false]
[ true, true, false, false, false ]

What it prints (run when this page was built)

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