parseEmbedMoves関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Reads a bounded JSON move list for a board embed, or null for malformed input.
インポート
import { parseEmbedMoves } from "@johnmorrisdotca/narabe/element";
ほかのエクスポート元: @johnmorrisdotca/narabe/element/define
定義
function parseEmbedMoves(value: string | null): MoveInput[] | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | string | null | JSON moves, or null for an empty record. |
戻り値
MoveInput[] | null
Valid move data, or null when the syntax, bounds or shape are invalid. Legality belongs to replayMoves.
例
import { parseEmbedMoves } from "@johnmorrisdotca/narabe/element";
console.log(parseEmbedMoves('[{"row":7,"col":7}]'));[ { row: 7, col: 7 } ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。