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

US_STATESconstant

Every name and other spelling of a US state in lower case, to its code: US_STATE_NAMES and US_STATE_ALTERNATIVES together.

Import it

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

Definition

const US_STATES: Record<string, string> = {
    ...US_STATE_NAMES,
    ...US_STATE_ALTERNATIVES,
}

Examples

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

console.log(US_STATES["mass"]);
// → "MA"
MA

What it prints (run when this page was built)

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