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

DIRECTION_EXPANSIONSconstant

Each directional abbreviation in lower case, to the word in full.

Import it

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

Definition

const DIRECTION_EXPANSIONS: Record<string, string> = {
    n: "North",
    s: "South",
    e: "East",
    w: "West",
    ne: "Northeast",
    nw: "Northwest",
    se: "Southeast",
    sw: "Southwest",
    o: "Ouest",
}

Examples

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

console.log(DIRECTION_EXPANSIONS["ne"]);
// → "Northeast"
Northeast

What it prints (run when this page was built)

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