Reference · Parsing, formatting and shared types
parseInformalAddressesfunction
Parses many loosely written addresses with parseInformalAddress, in order.
Import it
import { parseInformalAddresses } from "@johnmorrisdotca/address-plus";
Definition
function parseInformalAddresses(addresses: string[], options?: ParseOptions): (ParsedAddress | null)[]
Parameters
| Name | Type | Description |
|---|---|---|
addresses | string[] | The addresses, one string each. |
options (optional) | ParseOptions | undefined | How to parse every one of them (see |
Returns
(ParsedAddress | null)[]
One result per address, in the same order, null where nothing could be read.
Examples
import { parseInformalAddresses } from "@johnmorrisdotca/address-plus";
console.log(parseInformalAddresses(["Downtown near City Hall, Springfield IL 62701"]).map((one) => one?.zip));
// → ["62701"][ '62701' ]What it prints (run when this page was built)