spainconstant
Spain's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Spain,
España or ES, or has a Spanish street's type and a postcode of five digits and a place on its last line, is read as
Spanish; country: "ES" reads any address as one.
Import it
import { spain } from "@johnmorrisdotca/address-plus/es";
Definition
const spain: CountryModule = postcodeCountryModule(spanishSpec, (address) => formatCorreos(address))
Examples
import { parseLocation } from "@johnmorrisdotca/address-plus";
import { spain } from "@johnmorrisdotca/address-plus/es";
console.log(parseLocation("Calle de Alcalá, 42, 28014 Madrid", { countries: [spain] })?.state);
// → "M"MWhat it prints (run when this page was built)