Skip to the content

Kuni国

Look up countries, codes, names and subdivisions, load country data on demand and mount a native country card.

Kuni (国) is Japanese for a country. About the name

Contents

Reference · Regions and international bodies

membersOffunction

The members of a grouping: now, or on a given day for an international body.

Import it

import { membersOf } from "@johnmorrisdotca/kuni/groupings";

Definition

function membersOf(id: string, options?: GroupingDateOptions): readonly string[] | null

Parameters

NameTypeDescription
idstring

The grouping's id.

options (optional)GroupingDateOptions

on, a day such as "2019-06-30".

Returns

readonly string[] | null

The members' codes, frozen; null for an id that is not a grouping.

Examples

import { membersOf } from "@johnmorrisdotca/kuni/groupings";

console.log(membersOf("eu")?.includes("GB"));                       // false
console.log(membersOf("eu", { on: "2019-06-30" })?.includes("GB")); // true
console.log(membersOf("us-pacific"));                               // ["US-AK", "US-CA", "US-HI", "US-OR", "US-WA"]
false
true
[ 'US-AK', 'US-CA', 'US-HI', 'US-OR', 'US-WA' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kuni 1.4.0.