UNPKG

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.

20 lines (16 loc) 642 B
import { Locale } from '@scrabble-solver/types'; import { english, french, german, persian, polish, romanian, spanish, turkish } from './languages'; const crawlPerLocale: Record<Locale, (word: string) => Promise<string>> = { [Locale.DE_DE]: german.crawl, [Locale.EN_GB]: english.crawl, [Locale.EN_US]: english.crawl, [Locale.ES_ES]: spanish.crawl, [Locale.FA_IR]: persian.crawl, [Locale.FR_FR]: french.crawl, [Locale.PL_PL]: polish.crawl, [Locale.RO_RO]: romanian.crawl, [Locale.TR_TR]: turkish.crawl, }; export const crawl = (locale: Locale, word: string): Promise<string> => { return crawlPerLocale[locale](word); };