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 · /subdivision-names/es

SubdivisionNamestype

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

Import it

import type { SubdivisionNames } from "@johnmorrisdotca/kuni/subdivision-names/es";

Also exported from: @johnmorrisdotca/kuni/subdivision-names/de, @johnmorrisdotca/kuni/subdivision-names/zh-Hans, @johnmorrisdotca/kuni/subdivision-names/zh-Hant

Definition

interface SubdivisionNames {
    readonly language: SubdivisionNamesLanguage;
    subdivisionName(code: string): string | null;
    subdivisionNameSource(code: string): NameSource | null;
    subdivisionsByName(text: string, options?: SubdivisionNamesSearchOptions): readonly string[];
    subdivisionByName(text: string, options?: SubdivisionNamesSearchOptions): string | null;
    subdivisionsOf(countryCode: string): readonly NamedSubdivision[];
    count(): number;
    fold(text: string): string;
}

Members

NameTypeDescription
languageSubdivisionNamesLanguage

The language of this entry.

subdivisionName(code: string): string | null

A subdivision's name in this language by its ISO 3166-2 code (either case); null where no source gives one, and for a code that is not a subdivision.

subdivisionNameSource(code: string): NameSource | null

Where a subdivision's name came from; null where it has no name.

subdivisionsByName(text: string, options?: SubdivisionNamesSearchOptions): readonly string[]

Every code a typed name could be, in code order: the name as written, folded as fold folds. Empty for none.

subdivisionByName(text: string, options?: SubdivisionNamesSearchOptions): string | null

The one code a typed name means; null for none, and for a name that is more than one place (name the country).

subdivisionsOf(countryCode: string): readonly NamedSubdivision[]

A country's subdivisions that have a name in this language, in code order; empty for a country with none, and for a code that is not a country.

count(): number

How many subdivisions have a name in this language, over all countries.

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 { SubdivisionNames } from "@johnmorrisdotca/kuni/subdivision-names/es";

const read = (names: SubdivisionNames): string | null => names.subdivisionName("JP-13");
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.