Reference · Regions and international bodies
groupingsfunction
Every grouping, or those of one kind or inside one country, in a fixed order: continents, UN M49 areas, international bodies, informal groupings, then regions inside a country.
Import it
import { groupings } from "@johnmorrisdotca/kuni/groupings";
Definition
function groupings(options?: GroupingsOptions): readonly Grouping[]
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | GroupingsOptions |
|
Returns
readonly Grouping[]
The groupings, frozen; an empty list where none match.
Examples
import { groupings } from "@johnmorrisdotca/kuni/groupings";
console.log(groupings({ kind: "continent" }).map((one) => one.name.en)); // ["Africa", "Antarctica", "Asia", "Europe", ...]
console.log(groupings({ country: "JP" }).length); // 10: the eight 地方, and the nine-region variant's two[
'Africa',
'Antarctica',
'Asia',
'Europe',
'North America',
'Oceania',
'South America'
]
10What it prints (run when this page was built)