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

parseAddressesBatchfunction

Parses many street addresses with parseAddress, and reports which failed and how long it took.

Import it

import { parseAddressesBatch } from "@johnmorrisdotca/address-plus";

Definition

function parseAddressesBatch(addresses: string[], options?: BatchParseOptions): BatchParseResult<ParsedAddress>

Parameters

NameTypeDescription
addressesstring[]

The addresses, one string each.

options (optional)BatchParseOptions | undefined

How to parse, plus the batch settings (see BatchParseOptions).

Returns

BatchParseResult<ParsedAddress>

The results in order (null for a failure), the errors, and the counts and timing.

Examples

import { parseAddressesBatch } from "@johnmorrisdotca/address-plus";

console.log(parseAddressesBatch(["10 Main St, Anytown, NY 12345", "PO Box 12, Springfield, IL 62701"]).stats.successful);
// → 2
2

What it prints (run when this page was built)

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