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

foldfunction

What two ways of typing a name have in common: width (full-width letters to ASCII, half-width katakana to full), case, accents (except the two marks that make が and ぱ), katakana to hiragana, apostrophes dropped, and every other run of punctuation or space to one space. The lookups compare names folded, and so can a page.

Import it

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

Definition

function fold(text: string): string

Parameters

NameTypeDescription
textstring

Any text.

Returns

string

The text folded; "" for text that is only punctuation or space.

Examples

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

console.log(fold("Côte d'Ivoire"));   // "cote divoire"
console.log(fold("USA"));           // "usa"
console.log(fold("ドイツ"));           // "どいつ"
cote divoire
usa
どいつ

What it prints (run when this page was built)

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