Reference · Parsing, formatting and shared types
parseInformalAddressesBatchfunction
Parses many loosely written addresses with parseInformalAddress, and reports which failed and how long it took.
Import it
import { parseInformalAddressesBatch } from "@johnmorrisdotca/address-plus";
Definition
function parseInformalAddressesBatch(addresses: string[], options?: BatchParseOptions): BatchParseResult<ParsedAddress>
Parameters
| Name | Type | Description |
|---|---|---|
addresses | string[] | The addresses, one string each. |
options (optional) | BatchParseOptions | undefined | How to parse, plus the batch settings (see |
Returns
BatchParseResult<ParsedAddress>
The results in order (null for a failure), the errors, and the counts and timing.
Examples
import { parseInformalAddressesBatch } from "@johnmorrisdotca/address-plus";
console.log(parseInformalAddressesBatch(["Main St, Anytown NY"]).stats.successful);
// → 11What it prints (run when this page was built)