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.
16 lines (11 loc) • 372 B
text/typescript
import { type AutoGroupTiles } from '@/types';
import { NULL_VALUE } from './constants';
export const parseValue = (value: string): AutoGroupTiles => {
if (value === 'left' || value === 'right') {
return value;
}
if (value === NULL_VALUE) {
return null;
}
throw new Error(`"${value}" is not valid. Should be "left", "right", or "${NULL_VALUE}"`);
};