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 · /names/fr

Namestype

One language's names: what an entry @johnmorrisdotca/kuni/names/<language> exports. Every function is pure.

Import it

import type { Names } from "@johnmorrisdotca/kuni/names/fr";

Also exported from: @johnmorrisdotca/kuni/names/es, @johnmorrisdotca/kuni/names/de, @johnmorrisdotca/kuni/names/zh-Hans, @johnmorrisdotca/kuni/names/zh-Hant, @johnmorrisdotca/kuni/names/ko, @johnmorrisdotca/kuni/names/pt, @johnmorrisdotca/kuni/names/ar, @johnmorrisdotca/kuni/names/ru

Definition

interface Names {
    readonly language: NamesLanguage;
    countryName(code: string, options?: NamesNameOptions): string | null;
    countryVariants(code: string): readonly string[];
    countryByName(text: string): CountryCode | null;
    countries(options?: NamesListOptions): readonly NamedCountry[];
    fold(text: string): string;
}

Members

NameTypeDescription
languageNamesLanguage

The language of this entry.

countryName(code: string, options?: NamesNameOptions): string | null

A country's name in this language, as countryName(code, options) says.

countryVariants(code: string): readonly string[]

The variant forms CLDR gives for a country in this language; empty for most and for a code that is not a country.

countryByName(text: string): CountryCode | null

The country somebody typed, by name, short form, variant or alias in this language (or its alpha-2 code), as countryByName(text) says.

countries(options?: NamesListOptions): readonly NamedCountry[]

All 250 countries with their names in this language, in the order asked.

fold(text: string): string

What two ways of typing a name have in common in this language, as fold(text) says; the lookups compare names folded this way.

Examples

import type { Names } from "@johnmorrisdotca/kuni/names/fr";

const read = (names: Names): string | null => names.countryName("JP");
console.log(typeof read);   // "function"
function

What it prints (run when this page was built)

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