Reference · British country module
findUKNationfunction
Finds a nation of the United Kingdom by its code (SCT, GB-SCT) or its name in English or Japanese.
Import it
import { findUKNation } from "@johnmorrisdotca/address-plus/gb";
Definition
function findUKNation(text: string): (typeof GB_NATIONS)[number] | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The code or the name. |
Returns
UKNation | null
The nation, or null when nothing matches.
Examples
import { findUKNation } from "@johnmorrisdotca/address-plus/gb";
console.log(findUKNation("wales")?.code);
// → "WLS"WLSWhat it prints (run when this page was built)