Reference · Parsing, formatting and shared types
CA_REGIONSconstant
Every name and other spelling of a Canadian province or territory as a Region object, for fuzzy matching by
normalizeRegion.
Import it
import { CA_REGIONS } from "@johnmorrisdotca/address-plus";
Definition
const CA_REGIONS: Region[] = Object.entries(CA_PROVINCES).map(([name, abbr]) => ({
abbr,
country: "CA",
name,
}))
Examples
import { CA_REGIONS } from "@johnmorrisdotca/address-plus";
console.log(CA_REGIONS.filter((region) => region.abbr === "QC").map((region) => region.name));
// → ["quebec","québec","pq","que"][ 'quebec', 'québec', 'pq', 'que' ]What it prints (run when this page was built)