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

findItalianProvincefunction

Finds a province of Italy by its sigla (RM, IT-RM) or its name in English, ignoring accents and letter case.

Import it

import { findItalianProvince } from "@johnmorrisdotca/address-plus/it";

Definition

function findItalianProvince(query: string): PostcodeRegion | undefined

Parameters

NameTypeDescription
querystring

The province's sigla or name.

Returns

PostcodeRegion | undefined

The province, or undefined when none has that sigla or name.

Examples

import { findItalianProvince } from "@johnmorrisdotca/address-plus/it";

console.log([findItalianProvince("rm")?.name, findItalianProvince("IT-MI")?.code, findItalianProvince("ZZ")]);
// → ["Rome","MI",null]
[ 'Rome', 'MI', undefined ]

What it prints (run when this page was built)

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