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.

9 lines (6 loc) 400 B
import { type Locale, WordDefinition, type WordDefinitionJson } from '@scrabble-solver/types'; import { fetchJson } from './fetchJson'; export const findWordDefinitions = async (locale: Locale, word: string): Promise<WordDefinition[]> => { const json = await fetchJson<WordDefinitionJson[]>(`/api/dictionary/${locale}/${encodeURIComponent(word)}`); return json.map(WordDefinition.fromJson); };