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

looksItalianfunction

Whether an address is surely Italian, with no hint: it ends with Italy, Italia or IT, or its last line is a postcode of five digits and a place while a part of the address begins with an Italian street's type (Via, Viale, Corso, Piazza, Largo) or is a Casella Postale, and no state's code stands before the postcode.

Import it

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

Definition

function looksItalian(text: string): boolean

Parameters

NameTypeDescription
textstring

The address as one string.

Returns

boolean

true when the address is Italian beyond doubt, false otherwise.

Examples

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

console.log([looksItalian("Via Roma 12, 20121 Milano"), looksItalian("123 Main St, Seattle, WA 98101")]);
// → [true,false]
[ true, false ]

What it prints (run when this page was built)

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