looksDutchfunction
Whether an address is surely Dutch, with no hint: it ends with the Netherlands, Nederland or NL, or its last line is
a postcode of four digits and two letters (1015 CJ, never beginning SA, SD or SS) and a place. No other country writes
a postcode that way, so no address of another country has that shape.
Import it
import { looksDutch } from "@johnmorrisdotca/address-plus/nl";
Definition
function looksDutch(text: string): boolean
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The address as one string. |
Returns
boolean
true when the address is Dutch beyond doubt, false otherwise.
Examples
import { looksDutch } from "@johnmorrisdotca/address-plus/nl";
console.log([looksDutch("Keizersgracht 123, 1015 CJ Amsterdam"), looksDutch("123 Main St, Seattle, WA 98101")]);
// → [true,false][ true, false ]What it prints (run when this page was built)