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