Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

Reference · /it

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

NameTypeDescription
postcodestring

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.10.2.