Reference · German country module
parseGermanPostcodefunction
Takes a postcode apart: the Land it is in, from GeoNames' list (a postcode with places in two Länder takes the one most are in), and whether the list has it.
Import it
import { parseGermanPostcode } from "@johnmorrisdotca/address-plus/de";
Definition
function parseGermanPostcode(postcode: string): GermanPostcode | null
Parameters
| Name | Type | Description |
|---|---|---|
postcode | string | The postcode, with or without spaces. |
Returns
GermanPostcode | null
The parts, or null when it is not five digits.
Examples
import { parseGermanPostcode } from "@johnmorrisdotca/address-plus/de";
console.log(parseGermanPostcode("80331"));
// → {"postcode":"80331","state":"BY","known":true}{ postcode: '80331', state: 'BY', known: true }What it prints (run when this page was built)