import { Trie } from '@kamilmielnik/trie'; import { type Locale } from '@scrabble-solver/types'; import { fetchJson } from './fetchJson'; export const getDictionary = async (locale: Locale): Promise => { const serialized = await fetchJson(`/api/dictionary/${locale}`); return Trie.deserialize(serialized); };