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

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

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 { parseInformalAddressesBatch } from "@johnmorrisdotca/address-plus";

console.log(parseInformalAddressesBatch(["Main St, Anytown NY"]).stats.successful);
// → 1
1

What it prints (run when this page was built)

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