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) • 633 B
text/typescript
import { games, hasConfig, languages } from '@scrabble-solver/configs';
import { type Locale } from '@scrabble-solver/types';
export const getOptions = (locale: Locale) => {
const gameConfigs = Object.values(games);
const languageConfigs = Object.values(languages);
return gameConfigs.map((gameConfig) => {
const languageConfig = languageConfigs.find((config) => {
return config.game === gameConfig.game && config.locale === locale;
});
return {
disabled: !hasConfig(gameConfig.game, locale),
label: languageConfig?.config.name ?? gameConfig.name,
value: gameConfig.game,
};
});
};