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
| Name | Type | Description |
|---|---|---|
text | string | 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)