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

BatchParseStatstype

The counts and timing of a batch: how many were parsed, how many failed, and how long it took.

Import it

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

Definition

interface BatchParseStats {
    total: number;
    successful: number;
    failed: number;
    duration: number;
    averagePerAddress: number;
    addressesPerSecond: number;
}

Members

NameTypeDescription
totalnumber
successfulnumber
failednumber
durationnumber
averagePerAddressnumber
addressesPerSecondnumber

Examples

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

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