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

CleanAddressResulttype

What cleanAddressDetailed returns: the tidied address and what changed.

Import it

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

Definition

interface CleanAddressResult {
    cleanedAddress: string;
    wasModified: boolean;
    changes: string[];
}

Members

NameTypeDescription
cleanedAddressstring
wasModifiedboolean
changesstring[]

Examples

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

console.log(cleanAddressDetailed("123 main st, anytown, ny 12345").wasModified);
// → true
true

What it prints (run when this page was built)

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