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_STATE_ALTERNATIVESconstant

Other ways US states are written (shortened forms, old abbreviations, D.C.), in lower case, to their codes.

Import it

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

Definition

const US_STATE_ALTERNATIVES: Record<string, string> = {
    ala: "AL",
    bama: "AL",
    ariz: "AZ",
    ark: "AR",
    cal: "CA",
    cali: "CA",
    calif: "CA",
    colo: "CO",
    conn: "CT",
    del: "DE",
    dc: "DC",
    fla: "FL",
    ill: "IL",
    ind: "IN",
    kan: "KS",
    kans: "KS",
    ky: "KY",
    kent: "KY",
    la: "LA",
    lou: "LA",
    mass: "MA",
    mich: "MI",
    minn: "MN",
    miss: "MS",
    mo: "MO",
    mont: "MT",
    neb: "NE",
    nebr: "NE",
    nev: "NV",
    "new hamp": "NH",
    "new hampsh": "NH",
    "new jers": "NJ",
    "new mex": "NM",
    "new mexic": "NM",
    "n carolina": "NC",
    "north car": "NC",
    "n dakota": "ND",
    "north dak": "ND",
    okla: "OK",
    ore: "OR",
    oreg: "OR",
    penn: "PA",
    pa: "PA",
    penna: "PA",
    pennsyl: "PA",
    "rhode isl": "RI",
    "s carolina": "SC",
    "south car": "SC",
    "s dakota": "SD",
    "south dak": "SD",
    tenn: "TN",
    tex: "TX",
    vt: "VT",
    va: "VA",
    virg: "VA",
    wash: "WA",
    "west va": "WV",
    "west virg": "WV",
    wis: "WI",
    wisc: "WI",
    wyo: "WY",
}

Examples

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

console.log(US_STATE_ALTERNATIVES["calif"]);
// → "CA"
CA

What it prints (run when this page was built)

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