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

AddressAbbreviationstype

What getAddressAbbreviations returns: one map per kind of abbreviation.

Import it

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

Definition

interface AddressAbbreviations {
    streetTypes: Record<string, string>;
    directions: Record<string, string>;
    states: Record<string, string>;
    provinces: Record<string, string>;
    unitTypes: Record<string, string>;
}

Members

NameTypeDescription
streetTypesRecord<string, string>
directionsRecord<string, string>
statesRecord<string, string>
provincesRecord<string, string>
unitTypesRecord<string, string>

Examples

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

console.log(Object.keys(getAddressAbbreviations()));
// → ["streetTypes","directions","states","provinces","unitTypes"]
[ 'streetTypes', 'directions', 'states', 'provinces', 'unitTypes' ]

What it prints (run when this page was built)

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