parseEmbedMovesfunction
Reads a bounded JSON move list for a board embed, or null for malformed input.
Import it
import { parseEmbedMoves } from "@johnmorrisdotca/narabe/element";
Also exported from: @johnmorrisdotca/narabe/element/define
Definition
function parseEmbedMoves(value: string | null): MoveInput[] | null
Parameters
| Name | Type | Description |
|---|---|---|
value | string | null | JSON moves, or null for an empty record. |
Returns
MoveInput[] | null
Valid move data, or null when the syntax, bounds or shape are invalid. Legality belongs to replayMoves.
Examples
import { parseEmbedMoves } from "@johnmorrisdotca/narabe/element";
console.log(parseEmbedMoves('[{"row":7,"col":7}]'));[ { row: 7, col: 7 } ]What it prints (run when this page was built)