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.
10 lines (7 loc) • 329 B
text/typescript
import { Trie } from '@kamilmielnik/trie';
import { type Locale } from '@scrabble-solver/types';
import { fetchJson } from './fetchJson';
export const getDictionary = async (locale: Locale): Promise<Trie> => {
const serialized = await fetchJson<string>(`/api/dictionary/${locale}`);
return Trie.deserialize(serialized);
};