italyconstant
Italy's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Italy,
Italia or IT, or has an Italian street's type and a postcode of five digits and a place on its last line, is read as
Italian; country: "IT" reads any address as one.
Import it
import { italy } from "@johnmorrisdotca/address-plus/it";
Definition
const italy: CountryModule = postcodeCountryModule(italianSpec, (address) => formatPosteItaliane(address))
Examples
import { parseLocation } from "@johnmorrisdotca/address-plus";
import { italy } from "@johnmorrisdotca/address-plus/it";
console.log(parseLocation("Via del Corso, 12/A, 00186 Roma", { countries: [italy] })?.state);
// → "RM"RMWhat it prints (run when this page was built)