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 · British country module

UKNationCodetype

The code of one of the four nations of the United Kingdom, as ISO 3166-2:GB writes it after GB-.

Import it

import type { UKNationCode } from "@johnmorrisdotca/address-plus/gb";

Also exported from: @johnmorrisdotca/address-plus

Definition

type UKNationCode = "ENG" | "NIR" | "SCT" | "WLS";

Examples

import { getNationFromUKPostcode } from "@johnmorrisdotca/address-plus/gb";
import type { UKNationCode } from "@johnmorrisdotca/address-plus/gb";

console.log(getNationFromUKPostcode("CF10 1AA"));
// → "WLS"
WLS

What it prints (run when this page was built)

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