Reference · Parsing, formatting and shared types
parseIntersectionsfunction
Parses many intersections with parseIntersection, in order.
Import it
import { parseIntersections } from "@johnmorrisdotca/address-plus";
Definition
function parseIntersections(addresses: string[], options?: ParseOptions): (ParsedIntersection | null)[]
Parameters
| Name | Type | Description |
|---|---|---|
addresses | string[] | The intersections, one string each. |
options (optional) | ParseOptions | undefined | How to parse every one of them (see |
Returns
(ParsedIntersection | null)[]
One result per intersection, in the same order, null where one could not be read.
Examples
import { parseIntersections } from "@johnmorrisdotca/address-plus";
console.log(parseIntersections(["Yonge St and Bloor St, Toronto, ON"]).map((one) => one?.street2));
// → ["Bloor"][ 'Bloor' ]What it prints (run when this page was built)