Reference · British country module
getNationsForUKPostcodefunction
Every nation a postcode's district delivers to: one for most, two for the districts along the borders of Wales and of Scotland (from Code-Point Open), the nation with most of the district's postcodes first.
Import it
import { getNationsForUKPostcode } from "@johnmorrisdotca/address-plus/gb";
Definition
function getNationsForUKPostcode(postcode: string): UKNationCode[]
Parameters
| Name | Type | Description |
|---|---|---|
postcode | string | The postcode. |
Returns
UKNationCode[]
The nations; an empty array outside the United Kingdom or for text that is not a postcode.
Examples
import { getNationsForUKPostcode } from "@johnmorrisdotca/address-plus/gb";
console.log(getNationsForUKPostcode("SY10 7AA"));
// → ["ENG","WLS"][ 'ENG', 'WLS' ]What it prints (run when this page was built)