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

findGermanStatefunction

Finds a Land of Germany by its code (BY, DE-BY) or its name in English, German or Japanese, without regard to letter case or umlauts written as ae, oe, ue.

Import it

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

Definition

function findGermanState(text: string): GermanState | null

Parameters

NameTypeDescription
textstring

The code or the name.

Returns

GermanState | null

The Land, or null when nothing matches.

Examples

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

console.log([findGermanState("Bayern")?.code, findGermanState("thueringen")?.code, findGermanState("Lower Saxony")?.code]);
// → ["BY","TH","NI"]
[ 'BY', 'TH', 'NI' ]

What it prints (run when this page was built)

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