parseGermanAddress関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Parses an address in Germany into the parts Deutsche Post and DIN 5008 lay out: who it is care of (careOf, from
c/o, z. Hd., bei), the part of a building (building: Hinterhaus, Haus B, or a name above the street), a
flat (secUnitType and secUnitNum: Wohnung 12), a floor (floorType and floor: Obergeschoss and 2), the
street's whole name as written in street (Hauptstraße, Berliner Str., Am Markt), its house number in number
(12a, 12-14), a Postfach or Packstation (secUnitType and secUnitNum), the Ortsteil in locality, the place in
city, and the postcode in zip with the Land's code in state. The postcode may stand anywhere after the street;
D-10115 is read as 10115.
インポート
import { parseGermanAddress } from "@johnmorrisdotca/address-plus/de";
定義
function parseGermanAddress(text: string, options?: ParseOptions): ParsedAddress | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | The address as one string; commas and line breaks both separate its parts. |
options (省略可) | ParseOptions |
|
戻り値
ParsedAddress | null
The parts found, with country DE, or null when the text is empty or holds nothing that makes it an
address.
例
import { parseGermanAddress } from "@johnmorrisdotca/address-plus/de";
console.log(parseGermanAddress("c/o Weber, Hinterhaus, Hauptstraße 12a, 10115 Berlin"));
// → {"careOf":"Weber","building":"Hinterhaus","street":"Hauptstraße","number":"12A","city":"Berlin","state":"BE","zip":"10115","zipValid":true,"country":"DE"}{
careOf: 'Weber',
building: 'Hinterhaus',
street: 'Hauptstraße',
number: '12A',
city: 'Berlin',
state: 'BE',
zip: '10115',
zipValid: true,
country: 'DE'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。