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.
18 lines (14 loc) • 656 B
text/typescript
import { Locale } from '@scrabble-solver/types';
import { english, french, german, persian, polish, romanian, spanish, turkish } from './languages';
const localeMap: Record<Locale, () => Promise<string[]>> = {
[]: german.getWordList,
[]: english.getWordListGb,
[]: english.getWordListUs,
[]: spanish.getWordList,
[]: persian.getWordList,
[]: french.getWordList,
[]: polish.getWordList,
[]: romanian.getWordList,
[]: turkish.getWordList,
};
export const getWordList = (locale: Locale): Promise<string[]> => localeMap[locale]();