formatDeutschePost関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Writes an address in Germany as Deutsche Post asks: who it is care of (c/o), the part of the building, the flat and
the floor, the street and its house number, then the postcode and the place, each on its own line, with no punctuation
at the end of a line. A Postfach is written with its number in pairs (Postfach 12 34 56) and a Packstation with its
number.
インポート
import { formatDeutschePost } from "@johnmorrisdotca/address-plus/de";
定義
function formatDeutschePost(address: ParsedAddress, options?: DeutschePostFormattingOptions): FormattedAddress
引数
| 名前 | 型 | 説明 |
|---|---|---|
address | ParsedAddress | The address as |
options (省略可) | DeutschePostFormattingOptions | Whether to add the country (see |
戻り値
FormattedAddress
The lines, the same on one line, the delivery line (the street and its number) and the last line.
例
import { formatDeutschePost, parseGermanAddress } from "@johnmorrisdotca/address-plus/de";
const parsedAddress1=parseGermanAddress("Hinterhaus, 2. OG, Kastanienallee 4 b, 10435 Berlin");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatDeutschePost(parsedAddress1).lines);
// → ["Hinterhaus","2. OG","Kastanienallee 4B","10435 Berlin"][ 'Hinterhaus', '2. OG', 'Kastanienallee 4B', '10435 Berlin' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。