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
| Name | Type | Description |
|---|---|---|
text | string | 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)