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

BatchParseResulttype

What a batch parser returns: the results in order, the errors and the statistics.

Import it

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

Definition

interface BatchParseResult<T = ParsedAddress | ParsedIntersection> {
    results: (T | null)[];
    errors: BatchParseError[];
    stats: BatchParseStats;
}

Members

NameTypeDescription
results(T | null)[]
errorsBatchParseError[]
statsBatchParseStats

Examples

import { parseLocationsBatch } from "@johnmorrisdotca/address-plus";
import type { BatchParseResult } from "@johnmorrisdotca/address-plus";

console.log(parseLocationsBatch(["123 Main St, Anytown, NY 12345"]).results.length);
// → 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.