Skip to the content

Kotoba言葉

Load only the word lists you need, mark repeated letters correctly and play a daily or seeded word game.

Kotoba is the Japanese word for words. About the name

Contents

Reference · /children-filter

checkTextfunction

Check a name or other short text a child has typed. This is a floor; a person should still review it.

Import it

import { checkText } from "@johnmorrisdotca/kotoba/children-filter";

Definition

function checkText(text: string, options?: Options): Result

Parameters

NameTypeDescription
textstring

Text to check.

options (optional)Options

Language (default all), maximum length in Unicode code points (default 40), and mode: "name" (the default: a name needs letters, so only numbers and marks are refused) or "text" (numbers allowed, still read for jokes).

Returns

Result

Whether it is clean, or the reason it needs attention.

Examples

import { checkText } from "@johnmorrisdotca/kotoba/children-filter";
console.log(checkText("Luna").ok); // true
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kotoba 1.11.0.