scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
24 lines (18 loc) • 428 B
text/typescript
import { type CellJson, isCellJson } from './CellJson';
export type BoardJson = CellJson[][];
export const isBoardJson = (value: unknown): value is BoardJson => {
if (!Array.isArray(value)) {
return false;
}
for (const row of value) {
if (!Array.isArray(value)) {
return false;
}
for (const cell of row) {
if (!isCellJson(cell)) {
return false;
}
}
}
return true;
};