本文へ移動

Kuni国

国、コード、名前、行政区画を調べ、必要なときに国のデータを読み込み、標準の国のカードを表示できます。

「国(くに)」は、国を表す日本語です。 名前について(英語)

目次

リファレンス · 国と検索の道具

foldKana関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { foldKana } from "@johnmorrisdotca/kuni";

定義

function foldKana(text: string): string

引数

名前型説明
textstring

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

戻り値

string

The text with its kana folded.

例

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

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kuni 1.19.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。