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

CA_PROVINCE_NAMES_FRconstant

Every Canadian province and territory by its French name in lower case, to its two-letter code.

Import it

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

Definition

const CA_PROVINCE_NAMES_FR: Record<string, string> = {
    alberta: "AB",
    "colombie-britannique": "BC",
    manitoba: "MB",
    "nouveau-brunswick": "NB",
    "terre-neuve-et-labrador": "NL",
    "territoires du nord-ouest": "NT",
    "nouvelle-écosse": "NS",
    nunavut: "NU",
    ontario: "ON",
    "île-du-prince-édouard": "PE",
    québec: "QC",
    saskatchewan: "SK",
    yukon: "YT",
}

Examples

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

console.log(CA_PROVINCE_NAMES_FR["colombie-britannique"]);
// → "BC"
BC

What it prints (run when this page was built)

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