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 · /es

looksSpanishfunction

Whether an address is surely Spanish, with no hint: it ends with Spain, España or ES, or its last line is a postcode of five digits (the first two 01 to 52) and a place while a part of the address begins with a Spanish street's type (Calle, C/, Avenida, Paseo, Plaza) or is an Apartado de Correos, and no state's code stands before the postcode.

Import it

import { looksSpanish } from "@johnmorrisdotca/address-plus/es";

Definition

function looksSpanish(text: string): boolean

Parameters

NameTypeDescription
textstring

The address as one string.

Returns

boolean

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

Examples

import { looksSpanish } from "@johnmorrisdotca/address-plus/es";

console.log([looksSpanish("Calle Mayor 5, 28013 Madrid"), looksSpanish("Calle Ocho, Miami, FL 33135")]);
// → [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.