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