Reference · German country module
DeutschePostFormattingOptionstype
Options for formatDeutschePost.
Import it
import type { DeutschePostFormattingOptions } from "@johnmorrisdotca/address-plus/de";
Definition
interface DeutschePostFormattingOptions {
includeCountry?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
includeCountry (optional) | boolean | undefined |
Examples
import { formatDeutschePost, parseGermanAddress } from "@johnmorrisdotca/address-plus/de";
import type { DeutschePostFormattingOptions } from "@johnmorrisdotca/address-plus/de";
const parsedAddress1=parseGermanAddress("Hauptstr. 12, 10115 Berlin");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatDeutschePost(parsedAddress1, { includeCountry: true }).lines);
// → ["Hauptstr. 12","10115 Berlin","DEUTSCHLAND"][ 'Hauptstr. 12', '10115 Berlin', 'DEUTSCHLAND' ]What it prints (run when this page was built)