Reference · Rules, generation and deductions
validSettingsfunction
Reject a setting before it reaches a board allocation or a shuffle.
Import it
import { validSettings } from "@johnmorrisdotca/jirai";
Definition
function validSettings(value: unknown): value is Settings
Parameters
| Name | Type | Description |
|---|---|---|
value | unknown | The candidate field settings to validate. |
Returns
boolean
Reject a setting before it reaches a board allocation or a shuffle.
Examples
import type { Settings } from "@johnmorrisdotca/jirai";
import { validSettings } from "@johnmorrisdotca/jirai";
const settings: Settings={width:3,height:3,mines:1,grid:"square",noGuess:false,opening:"clear",seed:42};
console.log(validSettings(settings));trueWhat it prints (run when this page was built)