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

SECONDARY_UNIT_TYPESconstant

Each secondary unit designator, abbreviated or in full, in lower case, to the word the parser reports in full: USPS Publication 28 Appendix C2, and Canada Post's French unit words, which stay French.

Import it

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

Definition

const SECONDARY_UNIT_TYPES: Record<string, string> = {
    app: "Appartement",
    appartement: "Appartement",
    apartment: "Apartment",
    apartme: "Apartment",
    apt: "Apartment",
    basement: "Basement",
    bld: "Building",
    bldg: "Building",
    bsmt: "Basement",
    building: "Building",
    department: "Department",
    dept: "Department",
    fl: "Floor",
    floor: "Floor",
    flr: "Floor",
    front: "Front",
    frnt: "Front",
    gate: "Gate",
    bureau: "Bureau",
    hangar: "Hangar",
    hanger: "Hangar",
    hngr: "Hangar",
    key: "Key",
    lbby: "Lobby",
    level: "Level",
    lobby: "Lobby",
    lot: "Lot",
    lt: "Lot",
    lower: "Lower",
    lv: "Level",
    lowr: "Lower",
    ofc: "Office",
    office: "Office",
    penthouse: "Penthouse",
    pmb: "PMB",
    ph: "Penthouse",
    pier: "Pier",
    rear: "Rear",
    rm: "Room",
    room: "Room",
    side: "Side",
    slip: "Slip",
    space: "Space",
    spc: "Space",
    ste: "Suite",
    stop: "Stop",
    su: "Suite",
    suite: "Suite",
    trailer: "Trailer",
    trlr: "Trailer",
    unit: "Unit",
    unite: "Unité",
    unité: "Unité",
    upper: "Upper",
    uppr: "Upper",
}

Examples

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

console.log(SECONDARY_UNIT_TYPES["ste"]);
// → "Suite"
Suite

What it prints (run when this page was built)

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