UNPKG

scrabble-solver

Version:

Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.

20 lines (17 loc) 471 B
import { isObject } from './isObject'; import { isTileJson, type TileJson } from './TileJson'; export interface CellJson { isEmpty: boolean; tile: TileJson | null; x: number; y: number; } export const isCellJson = (value: unknown): value is CellJson => { return ( isObject(value) && typeof value.isEmpty === 'boolean' && (isTileJson(value.tile) || value.tile === null) && typeof value.x === 'number' && typeof value.y === 'number' ); };