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.

18 lines (17 loc) 621 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractWords = void 0; const findFirstWordIndex_1 = require("./findFirstWordIndex"); const extractWords = (file, locale) => { const lines = file.split(/\r?\n/g); const firstWordIndex = (0, findFirstWordIndex_1.findFirstWordIndex)(lines, locale); const words = []; for (let i = firstWordIndex; i < lines.length; ++i) { const trimmed = lines[i].trim(); if (trimmed.length > 0) { words.push(trimmed.toLocaleLowerCase()); } } return words; }; exports.extractWords = extractWords;