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

findSpanishProvincefunction

Finds a province of Spain by its code (M, ES-M) or its name in English, ignoring accents and letter case.

Import it

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

Definition

function findSpanishProvince(query: string): PostcodeRegion | undefined

Parameters

NameTypeDescription
querystring

The province's code or name.

Returns

PostcodeRegion | undefined

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

Examples

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

console.log([findSpanishProvince("seville")?.code, findSpanishProvince("ES-B")?.name, findSpanishProvince("zz")]);
// → ["SE","Barcelona",null]
[ 'SE', 'Barcelona', undefined ]

What it prints (run when this page was built)

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