Reference · Parsing, formatting and shared types
PROVINCE_EXPANSIONSconstant
Each Canadian province's code in lower case, to its name in lower case: English by default, the French names under their own keys.
Import it
import { PROVINCE_EXPANSIONS } from "@johnmorrisdotca/address-plus";
Definition
const PROVINCE_EXPANSIONS: Record<string, string> = {
...PROVINCE_EXPANSIONS_EN,
...Object.fromEntries(Object.entries(PROVINCE_EXPANSIONS_FR).map(([abbr, name]) => [`${abbr}_fr`, name])),
}
Examples
import { PROVINCE_EXPANSIONS } from "@johnmorrisdotca/address-plus";
console.log(PROVINCE_EXPANSIONS["on"]);
// → "ontario"ontarioWhat it prints (run when this page was built)