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 · Countries and lookup tools

dependenciesOffunction

The places that belong to a state: every country code whose sovereign is that state, in alpha-2 order.

Import it

import { dependenciesOf } from "@johnmorrisdotca/kuni";

Definition

function dependenciesOf(code: string): readonly Country[]

Parameters

NameTypeDescription
codestring

The state's code: alpha-2 ("GB", "gb"), alpha-3 ("GBR") or numeric ("826").

Returns

readonly Country[]

The places, frozen; an empty list for a state with none and for anything that is not a country code.

Examples

import { dependenciesOf } from "@johnmorrisdotca/kuni";

console.log(dependenciesOf("DK").map((one) => one.alpha2)); // ["FO", "GL"]
console.log(dependenciesOf("GB").length);                   // 15
console.log(dependenciesOf("JP").length);                   // 0
[ 'FO', 'GL' ]
15
0

What it prints (run when this page was built)

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