Reference · Parsing, formatting and shared types
CountryCodetype
A country code the parser reports: US, CA or JP.
Import it
import type { CountryCode } from "@johnmorrisdotca/address-plus";
Definition
type CountryCode = (typeof COUNTRIES)[keyof typeof COUNTRIES];
Examples
import { parseLocation } from "@johnmorrisdotca/address-plus";
import type { CountryCode } from "@johnmorrisdotca/address-plus";
console.log(parseLocation("100 Queen St W, Toronto, ON M5H 2N2")?.country);
// → "CA"CAWhat it prints (run when this page was built)