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
| Name | Type | Description |
|---|---|---|
text | string | 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); // truetrueWhat it prints (run when this page was built)