本文へ移動

address-plusアドレスプラス

住所を端末の中で解析・確認・整形・比較し、国のモジュールや任意のフォームの入力欄を使えます。

address-plusは、parse-addressの使い方を広げ、型付きの結果、確認、書式、国のモジュールを加えます。 名前について(英語)

目次

リファレンス · /nl

parseDutchAddress関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Parses an address in the Netherlands into the parts PostNL lays out: who it is care of (careOf), a building or name above the street (building), the street in street, the house number in number with its addition in numberExtension (the A of 123A, the 2 of 123-2, bis), a Postbus (secUnitType and secUnitNum), the place in city and the postcode in zip in its canonical form (1015 CJ). NL-1015CJ is read as 1015 CJ.

インポート

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

定義

function parseDutchAddress(text: string, options?: ParseOptions): ParsedAddress | null

引数

名前型説明
textstring

The address as one string; commas and line breaks both separate its parts.

options (省略可)ParseOptions

useSnakeCase gives snake_case keys; the other options are not used.

戻り値

ParsedAddress | null

The parts found, with country NL, or null when the text is empty or holds nothing that makes it an address.

例

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

console.log(parseDutchAddress("Keizersgracht 123A, 1015 CJ Amsterdam"));
// → {"number":"123","numberExtension":"A","street":"Keizersgracht","city":"Amsterdam","zip":"1015 CJ","zipValid":true,"country":"NL"}
{
  number: '123',
  numberExtension: 'A',
  street: 'Keizersgracht',
  city: 'Amsterdam',
  zip: '1015 CJ',
  zipValid: true,
  country: 'NL'
}

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/address-plus 1.10.2 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。