Reference · Parsing, formatting and shared types
US_STATE_EXPANSIONSconstant
Each US state's code in lower case, to its name in lower case: the reverse of US_STATE_NAMES.
Import it
import { US_STATE_EXPANSIONS } from "@johnmorrisdotca/address-plus";
Definition
const US_STATE_EXPANSIONS: Record<string, string> = Object.fromEntries(Object.entries(US_STATE_NAMES).map(([name, abbr]) => [abbr.toLowerCase(), name]))
Examples
import { US_STATE_EXPANSIONS } from "@johnmorrisdotca/address-plus";
console.log(US_STATE_EXPANSIONS["wa"]);
// → "washington"washingtonWhat it prints (run when this page was built)