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.

15 lines (10 loc) 466 B
import { type Config, type Game, type Locale } from '@scrabble-solver/types'; import * as languages from './languages'; export const getConfig = (game: Game, locale: Locale): Config => { const configs = Object.values(languages); const localeConfig = configs.find((config) => config.game === game && config.locale === locale); if (typeof localeConfig === 'undefined') { throw new Error(`No game "${game}" in "${locale}"`); } return localeConfig; };