本文へ移動

Kuni国

国、コード、名前、行政区画を調べ、必要なときに国のデータを読み込み、標準の国のカードを表示できます。

「国(くに)」は、国を表す日本語です。 名前について(英語)

目次

リファレンス · 地域と国際機関

groupings関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { groupings } from "@johnmorrisdotca/kuni/groupings";

定義

function groupings(options?: GroupingsOptions): readonly Grouping[]

引数

名前型説明
options (省略可)GroupingsOptions

kind to keep one kind, country to keep the groupings of one country's subdivisions.

戻り値

readonly Grouping[]

The groupings, frozen; an empty list where none match.

例

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'
]
10

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kuni 1.4.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。