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