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 · Places outside ISO 3166-1

reservedPlacefunction

One place outside ISO 3166-1, by its code ("IC", "ic"), its three letters ("ASC") or its id ("somaliland").

Import it

import { reservedPlace } from "@johnmorrisdotca/kuni/reserved";

Definition

function reservedPlace(text: string): ReservedPlace | null

Parameters

NameTypeDescription
textstring

A code, in either case, or an id.

Returns

ReservedPlace | null

The place, frozen; null for anything else, a country's code included.

Examples

import { reservedPlace } from "@johnmorrisdotca/kuni/reserved";

console.log(reservedPlace("IC")?.name.ja);            // "カナリア諸島"
console.log(reservedPlace("ea")?.subdivisions);       // ["ES-CE", "ES-ML"]
console.log(reservedPlace("AC")?.parent);             // "GB"
console.log(reservedPlace("somaliland")?.kind);       // "de-facto"
console.log(reservedPlace("JP"));                     // null
カナリア諸島
[ 'ES-CE', 'ES-ML' ]
GB
de-facto
null

What it prints (run when this page was built)

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