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

GermanPostcodetype

A postcode taken apart: the Land it is in, and whether GeoNames' list has it.

Import it

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

Also exported from: @johnmorrisdotca/address-plus

Definition

interface GermanPostcode {
    postcode: string;
    state?: GermanStateCode;
    known: boolean;
}

Members

NameTypeDescription
postcodestring
state (optional)GermanStateCode | undefined
knownboolean

Examples

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

console.log(parseGermanPostcode("10115"));
// → {"postcode":"10115","state":"BE","known":true}
{ postcode: '10115', state: 'BE', known: true }

What it prints (run when this page was built)

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