Reference · Rules, tiles and records
kumimojiRefusalfunction
A refusal: { ok: false }, the English reason (the clause of the code with the values in its gaps), the code
and the values.
Import it
import { kumimojiRefusal } from "@johnmorrisdotca/kumimoji";
Definition
function kumimojiRefusal(code: KumimojiCheckCode, values?: KumimojiCheckValues): Extract<KumimojiCheck, { ok: false; }>
Parameters
| Name | Type | Description |
|---|---|---|
code | "no-hand" | "givens-not-bag" | "wild-count-wrong" | "bag-exceeds-set" | "answer-not-grid" | "grid-not-the-bag" | "tiles-apart" | "not-a-word" | "grid-not-finished" | Why the grid is not taken. |
values (optional) | Readonly<Record<string, string | number>> | undefined | What fills the clause's gaps, where it has any. |
Returns
{ ok: false; reason: string; code: KumimojiCheckCode; values?: KumimojiCheckValues; }
The refusal checkKumimoji gives.
Examples
import { kumimojiRefusal } from "@johnmorrisdotca/kumimoji";
console.log(kumimojiRefusal("not-a-word", { word: "aow" }));{
ok: false,
reason: 'aow is not in the word list',
code: 'not-a-word',
values: { word: 'aow' }
}What it prints (run when this page was built)