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

PostNLFormattingOptionstype

Options for formatPostNL.

Import it

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

Definition

interface PostNLFormattingOptions {
    includeCountry?: boolean;
}

Members

NameTypeDescription
includeCountry (optional)boolean | undefined

Examples

import { formatPostNL, parseDutchAddress } from "@johnmorrisdotca/address-plus/nl";
import type { PostNLFormattingOptions } from "@johnmorrisdotca/address-plus/nl";

const options: PostNLFormattingOptions = { includeCountry: true };
const parsedAddress1 = parseDutchAddress("Keizersgracht 123, 1015 CJ Amsterdam");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatPostNL(parsedAddress1, options).lines);
// → ["Keizersgracht 123","1015 CJ Amsterdam","NEDERLAND"]
[ 'Keizersgracht 123', '1015 CJ Amsterdam', 'NEDERLAND' ]

What it prints (run when this page was built)

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