getProvinceFromItalianPostcodefunction
The province a postcode is in, by its sigla (RM): the one most of GeoNames' places for the postcode are in.
Import it
import { getProvinceFromItalianPostcode } from "@johnmorrisdotca/address-plus/it";
Definition
function getProvinceFromItalianPostcode(postcode: string): string | undefined
Parameters
| Name | Type | Description |
|---|---|---|
postcode | string | The postcode. |
Returns
string | undefined
The province's sigla, or undefined when the list does not have the postcode.
Examples
import { getProvinceFromItalianPostcode } from "@johnmorrisdotca/address-plus/it";
console.log(["00186", "20121", "80132", "10121", "00000"].map(getProvinceFromItalianPostcode));
// → ["RM","MI","NA","TO",null][ 'RM', 'MI', 'NA', 'TO', undefined ]What it prints (run when this page was built)