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.
14 lines (10 loc) • 311 B
text/typescript
import { type InputMode } from '@/types';
export const parseValue = (value: string): InputMode => {
if (value === 'keyboard') {
return 'keyboard';
}
if (value === 'touchscreen') {
return 'touchscreen';
}
throw new Error(`"${value}" is not valid. Should be "keyboard" or "touchscreen"`);
};