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.
14 lines (13 loc) • 600 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWordDefinition = void 0;
const types_1 = require("@scrabble-solver/types");
const crawl_1 = require("./crawl");
const parse_1 = require("./parse");
const getWordDefinition = async (locale, word, isAllowed) => {
const html = await (0, crawl_1.crawl)(locale, word);
const { definitions, exists } = (0, parse_1.parse)(locale, html);
const wordDefinition = new types_1.WordDefinition({ definitions, exists, isAllowed, word });
return wordDefinition;
};
exports.getWordDefinition = getWordDefinition;