Reference · Parsing, formatting and shared types
CA_PROVINCE_NAMES_ENconstant
Every Canadian province and territory by its English name in lower case, to its two-letter code.
Import it
import { CA_PROVINCE_NAMES_EN } from "@johnmorrisdotca/address-plus";
Definition
const CA_PROVINCE_NAMES_EN: Record<string, string> = {
alberta: "AB",
"british columbia": "BC",
manitoba: "MB",
"new brunswick": "NB",
"newfoundland and labrador": "NL",
"northwest territories": "NT",
"nova scotia": "NS",
nunavut: "NU",
ontario: "ON",
"prince edward island": "PE",
quebec: "QC",
saskatchewan: "SK",
yukon: "YT",
}
Examples
import { CA_PROVINCE_NAMES_EN } from "@johnmorrisdotca/address-plus";
console.log(CA_PROVINCE_NAMES_EN["british columbia"]);
// → "BC"BCWhat it prints (run when this page was built)