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
| Name | Type | Description |
|---|---|---|
id | string | The grouping's id. |
options (optional) | GroupingDateOptions |
|
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)