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 · German country module

GermanAddressFieldstype

The fields an address in Germany fills beside the shared ones. The shared fields keep their meaning: street is the whole name of the street as written (Hauptstraße, Berliner Str., Am Markt), number the house number with its letter (12a) or range (12-14), secUnitType and secUnitNum a flat (Wohnung 12), a box (Postfach 12 34 56) or a Packstation, floorType and floor a floor (OG and 2), building a wing, a house or a name (Hinterhaus, Haus B), locality the Ortsteil, city the place, state the Land's code and zip the postcode.

Import it

import type { GermanAddressFields } from "@johnmorrisdotca/address-plus/de";

Also exported from: @johnmorrisdotca/address-plus

Definition

interface GermanAddressFields {
    careOf?: string;
}

Members

NameTypeDescription
careOf (optional)string | undefined

Examples

import { parseGermanAddress } from "@johnmorrisdotca/address-plus/de";
import type { GermanAddressFields } from "@johnmorrisdotca/address-plus/de";

console.log(parseGermanAddress("c/o Weber, Hauptstraße 12a, 10115 Berlin")?.careOf);
// → "Weber"
Weber

What it prints (run when this page was built)

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