Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

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

NameTypeDescription
addressesstring[]

The intersections, one string each.

options (optional)ParseOptions | undefined

How to parse every one of them (see ParseOptions).

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.7.0.