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

foldKanafunction

Fold kana for a search: half-width katakana to full width, hiragana to katakana, and a small kana to its full-size one. The long-vowel mark stays, and so does anything that is not kana, including letter case. fold applies this and then its own rules, and the name lookups use fold, so a small kana and a full-size one find the same place.

Import it

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

Definition

function foldKana(text: string): string

Parameters

NameTypeDescription
textstring

What was typed, or a name to compare it with.

Returns

string

The text with its kana folded.

Examples

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

console.log(foldKana("とうきょう"));   // "トウキヨウ"
console.log(foldKana("はっぶる"));     // "ハツブル"
console.log(foldKana("ラー"));         // "ラー"
トウキヨウ
ハツブル
ラー

What it prints (run when this page was built)

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