@scrabble-solver/scrabble-solver 2.8.7 → 2.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +10 -10
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/413.js +257 -55
- package/.next/server/chunks/44.js +802 -0
- package/.next/server/chunks/515.js +452 -104
- package/.next/server/chunks/911.js +53 -23
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/api/solve.js +193 -927
- package/.next/server/pages/api/solve.js.nft.json +1 -1
- package/.next/server/pages/api/verify.js +217 -0
- package/.next/server/pages/api/verify.js.nft.json +1 -0
- package/.next/server/pages/index.html +3 -3
- package/.next/server/pages/index.js +7 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/server/pages-manifest.json +1 -0
- package/.next/static/chunks/317-a33dd38e9b9a17ed.js +1 -0
- package/.next/static/chunks/pages/{404-30c06e61d256c5b2.js → 404-90c624da3c83fd17.js} +1 -1
- package/.next/static/chunks/pages/_app-f8f360878e1c2aff.js +1 -0
- package/.next/static/chunks/pages/index-ecea697d3e5d8a6f.js +1 -0
- package/.next/static/css/64dc2ce1811912f1.css +1 -0
- package/.next/static/css/{cdbc9e0afcff5473.css → ad2a08918868cad8.css} +1 -1
- package/.next/static/yCxjzzYpw5JjJE53PO_s6/_buildManifest.js +1 -0
- package/.next/static/{z_0_lqfmiI_ISokr6NNRq → yCxjzzYpw5JjJE53PO_s6}/_ssgManifest.js +0 -0
- package/.next/trace +42 -40
- package/package.json +9 -9
- package/src/components/Badge/Badge.module.scss +13 -0
- package/src/components/Badge/Badge.tsx +15 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Board/components/Cell/Cell.module.scss +34 -9
- package/src/components/Board/components/Cell/Cell.tsx +23 -4
- package/src/components/Board/components/Cell/CellPure.tsx +29 -1
- package/src/components/Board/hooks/useGrid.ts +1 -0
- package/src/components/NavButtons/NavButtons.tsx +33 -14
- package/src/components/RemainingTiles/RemainingTiles.module.scss +8 -7
- package/src/components/RemainingTiles/RemainingTiles.tsx +13 -4
- package/src/components/Sidebar/Sidebar.tsx +2 -2
- package/src/components/Sidebar/components/Section/Section.module.scss +0 -1
- package/src/components/Sidebar/components/Section/Section.tsx +1 -1
- package/src/components/SquareButton/SquareButton.module.scss +5 -0
- package/src/components/Words/Words.module.scss +35 -0
- package/src/components/Words/Words.tsx +57 -0
- package/src/components/Words/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/i18n/de.json +5 -1
- package/src/i18n/en.json +5 -1
- package/src/i18n/es.json +5 -1
- package/src/i18n/fr.json +5 -1
- package/src/i18n/pl.json +5 -1
- package/src/icons/BookHalf.svg +4 -0
- package/src/icons/Check.svg +4 -0
- package/src/icons/Cross.svg +2 -2
- package/src/icons/CrossFill.svg +4 -0
- package/src/icons/Flag.svg +4 -0
- package/src/icons/Star.svg +4 -0
- package/src/icons/index.ts +5 -0
- package/src/pages/api/solve.ts +2 -3
- package/src/pages/api/verify.ts +71 -0
- package/src/pages/index.tsx +5 -0
- package/src/sdk/index.ts +1 -0
- package/src/sdk/verify.ts +24 -0
- package/src/state/rootReducer.ts +12 -1
- package/src/state/sagas.ts +54 -7
- package/src/state/selectors.ts +49 -11
- package/src/state/slices/cellFilterInitialState.ts +7 -0
- package/src/state/slices/cellFilterSlice.ts +24 -0
- package/src/state/slices/index.ts +4 -0
- package/src/state/slices/verifyInitialState.ts +12 -0
- package/src/state/slices/verifySlice.ts +31 -0
- package/src/styles/variables.scss +2 -1
- package/src/types/index.ts +5 -1
- package/.next/static/chunks/56-cf37c430261bbea5.js +0 -1
- package/.next/static/chunks/pages/_app-0b12a65bea70a0df.js +0 -1
- package/.next/static/chunks/pages/index-fcb69802550afb81.js +0 -1
- package/.next/static/css/1f39b55d50f5b30b.css +0 -1
- package/.next/static/z_0_lqfmiI_ISokr6NNRq/_buildManifest.js +0 -1
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.id = 44;
|
|
3
|
+
exports.ids = [44];
|
|
4
|
+
exports.modules = {
|
|
5
|
+
|
|
6
|
+
/***/ 21285:
|
|
7
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14
|
+
const logger_1 = __importDefault(__webpack_require__(52954));
|
|
15
|
+
const types_1 = __webpack_require__(46452);
|
|
16
|
+
const fs_1 = __importDefault(__webpack_require__(57147));
|
|
17
|
+
const constants_1 = __webpack_require__(75823);
|
|
18
|
+
const lib_1 = __webpack_require__(26137);
|
|
19
|
+
class Dictionaries {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.cache = new lib_1.LayeredCache();
|
|
22
|
+
this.downloadDictionaryProxies = Object.fromEntries(Object.values(types_1.Locale).map((locale) => [locale, (0, lib_1.createAsyncProxy)(() => (0, lib_1.downloadDictionary)(locale))]));
|
|
23
|
+
}
|
|
24
|
+
async get(locale) {
|
|
25
|
+
if (this.cache.has(locale)) {
|
|
26
|
+
const trie = await this.cache.get(locale);
|
|
27
|
+
if (trie) {
|
|
28
|
+
return trie;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
logger_1.default.info('Dictionaries - cache miss', { locale });
|
|
32
|
+
return this.updateDictionary(locale);
|
|
33
|
+
}
|
|
34
|
+
remove() {
|
|
35
|
+
fs_1.default.rmdirSync(constants_1.OUTPUT_DIRECTORY, { recursive: true });
|
|
36
|
+
}
|
|
37
|
+
async update(force) {
|
|
38
|
+
const locales = force ? Object.values(types_1.Locale) : this.getLocalesToUpdate();
|
|
39
|
+
logger_1.default.info('Dictionaries - update', { force, locales });
|
|
40
|
+
await Promise.all(locales.map((locale) => this.updateDictionary(locale)));
|
|
41
|
+
}
|
|
42
|
+
getLocalesToUpdate() {
|
|
43
|
+
return Object.values(types_1.Locale).filter((locale) => this.cache.isStale(locale) !== false);
|
|
44
|
+
}
|
|
45
|
+
async updateDictionary(locale) {
|
|
46
|
+
logger_1.default.info('Dictionaries - updateDictionary', { locale });
|
|
47
|
+
fs_1.default.mkdirSync(constants_1.OUTPUT_DIRECTORY, { recursive: true });
|
|
48
|
+
const downloadDictionaryProxy = this.downloadDictionaryProxies[locale];
|
|
49
|
+
const trie = await downloadDictionaryProxy();
|
|
50
|
+
await this.cache.set(locale, trie);
|
|
51
|
+
return trie;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports["default"] = Dictionaries;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/***/ }),
|
|
58
|
+
|
|
59
|
+
/***/ 75823:
|
|
60
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
64
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
67
|
+
exports.OUTPUT_DIRECTORY = exports.CACHE_STALE_THRESHOLD = exports.DAY = void 0;
|
|
68
|
+
const os_1 = __importDefault(__webpack_require__(22037));
|
|
69
|
+
const path_1 = __importDefault(__webpack_require__(71017));
|
|
70
|
+
exports.DAY = 24 * 60 * 60 * 1000;
|
|
71
|
+
exports.CACHE_STALE_THRESHOLD = 30 * exports.DAY;
|
|
72
|
+
exports.OUTPUT_DIRECTORY = path_1.default.resolve(os_1.default.homedir(), '.scrabble-solver', 'dictionaries');
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
/***/ }),
|
|
76
|
+
|
|
77
|
+
/***/ 89044:
|
|
78
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
82
|
+
if (k2 === undefined) k2 = k;
|
|
83
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
84
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
85
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
86
|
+
}
|
|
87
|
+
Object.defineProperty(o, k2, desc);
|
|
88
|
+
}) : (function(o, m, k, k2) {
|
|
89
|
+
if (k2 === undefined) k2 = k;
|
|
90
|
+
o[k2] = m[k];
|
|
91
|
+
}));
|
|
92
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
93
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
94
|
+
};
|
|
95
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
96
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
97
|
+
};
|
|
98
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
99
|
+
exports.dictionaries = void 0;
|
|
100
|
+
const Dictionaries_1 = __importDefault(__webpack_require__(21285));
|
|
101
|
+
__exportStar(__webpack_require__(26137), exports);
|
|
102
|
+
exports.dictionaries = new Dictionaries_1.default();
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/***/ }),
|
|
106
|
+
|
|
107
|
+
/***/ 2812:
|
|
108
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
112
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
113
|
+
};
|
|
114
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
115
|
+
const trie_1 = __webpack_require__(83140);
|
|
116
|
+
const fs_1 = __importDefault(__webpack_require__(57147));
|
|
117
|
+
const constants_1 = __webpack_require__(75823);
|
|
118
|
+
const getDictionaryFilepath_1 = __importDefault(__webpack_require__(68638));
|
|
119
|
+
class DiskCache {
|
|
120
|
+
async get(locale) {
|
|
121
|
+
if (!this.has(locale)) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
const filepath = (0, getDictionaryFilepath_1.default)(locale);
|
|
125
|
+
const serialized = await fs_1.default.promises.readFile(filepath, 'utf-8');
|
|
126
|
+
const trie = trie_1.Trie.deserialize(serialized);
|
|
127
|
+
return trie;
|
|
128
|
+
}
|
|
129
|
+
getLastModifiedTimestamp(locale) {
|
|
130
|
+
const filepath = (0, getDictionaryFilepath_1.default)(locale);
|
|
131
|
+
if (!fs_1.default.existsSync(filepath)) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const stats = fs_1.default.statSync(filepath);
|
|
135
|
+
return stats.mtimeMs;
|
|
136
|
+
}
|
|
137
|
+
has(locale) {
|
|
138
|
+
const filepath = (0, getDictionaryFilepath_1.default)(locale);
|
|
139
|
+
return fs_1.default.existsSync(filepath);
|
|
140
|
+
}
|
|
141
|
+
isStale(locale) {
|
|
142
|
+
if (!this.has(locale)) {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
const lastModifiedTimestamp = this.getLastModifiedTimestamp(locale);
|
|
146
|
+
if (typeof lastModifiedTimestamp === 'undefined') {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
const timeSinceModification = Math.abs(lastModifiedTimestamp - Date.now());
|
|
150
|
+
return timeSinceModification > constants_1.CACHE_STALE_THRESHOLD;
|
|
151
|
+
}
|
|
152
|
+
async set(locale, trie) {
|
|
153
|
+
const filepath = (0, getDictionaryFilepath_1.default)(locale);
|
|
154
|
+
await fs_1.default.promises.writeFile(filepath, trie.serialize());
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports["default"] = DiskCache;
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/***/ }),
|
|
161
|
+
|
|
162
|
+
/***/ 70287:
|
|
163
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
167
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
168
|
+
};
|
|
169
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
170
|
+
const createCacheTimestampComparator_1 = __importDefault(__webpack_require__(20494));
|
|
171
|
+
const DiskCache_1 = __importDefault(__webpack_require__(2812));
|
|
172
|
+
const MemoryCache_1 = __importDefault(__webpack_require__(50192));
|
|
173
|
+
class LayeredCache {
|
|
174
|
+
constructor() {
|
|
175
|
+
this.layers = [new MemoryCache_1.default(), new DiskCache_1.default()];
|
|
176
|
+
}
|
|
177
|
+
async get(locale) {
|
|
178
|
+
const cache = this.getLastModifiedLayer(locale);
|
|
179
|
+
if (!cache) {
|
|
180
|
+
return Promise.resolve(undefined);
|
|
181
|
+
}
|
|
182
|
+
const [memoryCache, diskCache] = this.layers;
|
|
183
|
+
const value = await cache.get(locale);
|
|
184
|
+
if (cache === diskCache && typeof value !== 'undefined') {
|
|
185
|
+
await memoryCache.set(locale, value);
|
|
186
|
+
}
|
|
187
|
+
return value;
|
|
188
|
+
}
|
|
189
|
+
getLastModifiedTimestamp(locale) {
|
|
190
|
+
const cache = this.getLastModifiedLayer(locale);
|
|
191
|
+
if (!cache) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
return cache.getLastModifiedTimestamp(locale);
|
|
195
|
+
}
|
|
196
|
+
has(locale) {
|
|
197
|
+
return this.layers.some((cache) => cache.has(locale));
|
|
198
|
+
}
|
|
199
|
+
isStale(locale) {
|
|
200
|
+
if (this.layers.some((cache) => cache.isStale(locale))) {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
if (this.layers.every((cache) => typeof cache.isStale(locale) === 'undefined')) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
async set(locale, trie) {
|
|
209
|
+
const [memoryCache, diskCache] = this.layers;
|
|
210
|
+
await diskCache.set(locale, trie);
|
|
211
|
+
await memoryCache.set(locale, trie);
|
|
212
|
+
}
|
|
213
|
+
getLastModifiedLayer(locale) {
|
|
214
|
+
const layers = this.layers.filter((cache) => cache.has(locale));
|
|
215
|
+
const [cached] = [...layers].sort((0, createCacheTimestampComparator_1.default)(locale));
|
|
216
|
+
return cached;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
exports["default"] = LayeredCache;
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/***/ }),
|
|
223
|
+
|
|
224
|
+
/***/ 50192:
|
|
225
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
229
|
+
const constants_1 = __webpack_require__(75823);
|
|
230
|
+
class MemoryCache {
|
|
231
|
+
constructor() {
|
|
232
|
+
this.cache = {};
|
|
233
|
+
this.cacheTimestamps = {};
|
|
234
|
+
}
|
|
235
|
+
get(locale) {
|
|
236
|
+
return Promise.resolve(this.cache[locale]);
|
|
237
|
+
}
|
|
238
|
+
getLastModifiedTimestamp(locale) {
|
|
239
|
+
return this.cacheTimestamps[locale];
|
|
240
|
+
}
|
|
241
|
+
has(locale) {
|
|
242
|
+
return typeof this.cache[locale] !== 'undefined';
|
|
243
|
+
}
|
|
244
|
+
isStale(locale) {
|
|
245
|
+
const timestamp = this.getLastModifiedTimestamp(locale);
|
|
246
|
+
if (!this.has(locale) || typeof timestamp === 'undefined') {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
const timeSinceModification = Math.abs(timestamp - Date.now());
|
|
250
|
+
return timeSinceModification > constants_1.CACHE_STALE_THRESHOLD;
|
|
251
|
+
}
|
|
252
|
+
set(locale, trie) {
|
|
253
|
+
this.cacheTimestamps[locale] = Date.now();
|
|
254
|
+
this.cache[locale] = trie;
|
|
255
|
+
return Promise.resolve();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
exports["default"] = MemoryCache;
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
/***/ }),
|
|
262
|
+
|
|
263
|
+
/***/ 26554:
|
|
264
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
268
|
+
const createAsyncProxy = (asyncCallback) => {
|
|
269
|
+
let promise = null;
|
|
270
|
+
return async () => {
|
|
271
|
+
if (promise) {
|
|
272
|
+
return promise;
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
promise = asyncCallback();
|
|
276
|
+
return await promise;
|
|
277
|
+
}
|
|
278
|
+
finally {
|
|
279
|
+
promise = null;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
exports["default"] = createAsyncProxy;
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
/***/ }),
|
|
287
|
+
|
|
288
|
+
/***/ 20494:
|
|
289
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
293
|
+
const createCacheTimestampComparator = (locale) => {
|
|
294
|
+
return (a, b) => {
|
|
295
|
+
const aTimestamp = a.getLastModifiedTimestamp(locale);
|
|
296
|
+
const bTimestamp = b.getLastModifiedTimestamp(locale);
|
|
297
|
+
if (aTimestamp === bTimestamp) {
|
|
298
|
+
return 0;
|
|
299
|
+
}
|
|
300
|
+
if (typeof aTimestamp === 'undefined') {
|
|
301
|
+
return 1;
|
|
302
|
+
}
|
|
303
|
+
if (typeof bTimestamp === 'undefined') {
|
|
304
|
+
return -1;
|
|
305
|
+
}
|
|
306
|
+
return bTimestamp - aTimestamp;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
exports["default"] = createCacheTimestampComparator;
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
/***/ }),
|
|
313
|
+
|
|
314
|
+
/***/ 41281:
|
|
315
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
319
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
320
|
+
};
|
|
321
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
322
|
+
const trie_1 = __webpack_require__(83140);
|
|
323
|
+
const logger_1 = __importDefault(__webpack_require__(52954));
|
|
324
|
+
const word_lists_1 = __webpack_require__(51585);
|
|
325
|
+
const downloadDictionary = async (locale) => {
|
|
326
|
+
logger_1.default.info('downloadDictionary', { locale });
|
|
327
|
+
const words = await (0, word_lists_1.getWordList)(locale);
|
|
328
|
+
logger_1.default.info('downloadDictionary - success', { locale });
|
|
329
|
+
const trie = trie_1.Trie.fromArray(words);
|
|
330
|
+
return trie;
|
|
331
|
+
};
|
|
332
|
+
exports["default"] = downloadDictionary;
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
/***/ }),
|
|
336
|
+
|
|
337
|
+
/***/ 68638:
|
|
338
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
342
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
343
|
+
};
|
|
344
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
345
|
+
const path_1 = __importDefault(__webpack_require__(71017));
|
|
346
|
+
const constants_1 = __webpack_require__(75823);
|
|
347
|
+
const getDictionaryFilepath = (locale) => {
|
|
348
|
+
return path_1.default.resolve(constants_1.OUTPUT_DIRECTORY, `${locale}.txt`);
|
|
349
|
+
};
|
|
350
|
+
exports["default"] = getDictionaryFilepath;
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
/***/ }),
|
|
354
|
+
|
|
355
|
+
/***/ 26137:
|
|
356
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
360
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
361
|
+
};
|
|
362
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
363
|
+
exports.MemoryCache = exports.LayeredCache = exports.getDictionaryFilepath = exports.downloadDictionary = exports.DiskCache = exports.createCacheTimestampComparator = exports.createAsyncProxy = void 0;
|
|
364
|
+
var createAsyncProxy_1 = __webpack_require__(26554);
|
|
365
|
+
Object.defineProperty(exports, "createAsyncProxy", ({ enumerable: true, get: function () { return __importDefault(createAsyncProxy_1).default; } }));
|
|
366
|
+
var createCacheTimestampComparator_1 = __webpack_require__(20494);
|
|
367
|
+
Object.defineProperty(exports, "createCacheTimestampComparator", ({ enumerable: true, get: function () { return __importDefault(createCacheTimestampComparator_1).default; } }));
|
|
368
|
+
var DiskCache_1 = __webpack_require__(2812);
|
|
369
|
+
Object.defineProperty(exports, "DiskCache", ({ enumerable: true, get: function () { return __importDefault(DiskCache_1).default; } }));
|
|
370
|
+
var downloadDictionary_1 = __webpack_require__(41281);
|
|
371
|
+
Object.defineProperty(exports, "downloadDictionary", ({ enumerable: true, get: function () { return __importDefault(downloadDictionary_1).default; } }));
|
|
372
|
+
var getDictionaryFilepath_1 = __webpack_require__(68638);
|
|
373
|
+
Object.defineProperty(exports, "getDictionaryFilepath", ({ enumerable: true, get: function () { return __importDefault(getDictionaryFilepath_1).default; } }));
|
|
374
|
+
var LayeredCache_1 = __webpack_require__(70287);
|
|
375
|
+
Object.defineProperty(exports, "LayeredCache", ({ enumerable: true, get: function () { return __importDefault(LayeredCache_1).default; } }));
|
|
376
|
+
var MemoryCache_1 = __webpack_require__(50192);
|
|
377
|
+
Object.defineProperty(exports, "MemoryCache", ({ enumerable: true, get: function () { return __importDefault(MemoryCache_1).default; } }));
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
/***/ }),
|
|
381
|
+
|
|
382
|
+
/***/ 61704:
|
|
383
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
387
|
+
const lib_1 = __webpack_require__(60337);
|
|
388
|
+
const FILE_URL = 'https://raw.githubusercontent.com/enz/german-wordlist/master/words';
|
|
389
|
+
const getDeDeWordList = async () => {
|
|
390
|
+
return (0, lib_1.getTxtWordList)(FILE_URL);
|
|
391
|
+
};
|
|
392
|
+
exports["default"] = getDeDeWordList;
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
/***/ }),
|
|
396
|
+
|
|
397
|
+
/***/ 3284:
|
|
398
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
402
|
+
const lib_1 = __webpack_require__(60337);
|
|
403
|
+
const FILE_URL = 'https://www.wordgamedictionary.com/sowpods/download/sowpods.txt';
|
|
404
|
+
const getEnGbWordList = async () => {
|
|
405
|
+
return (0, lib_1.getTxtWordList)(FILE_URL);
|
|
406
|
+
};
|
|
407
|
+
exports["default"] = getEnGbWordList;
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
/***/ }),
|
|
411
|
+
|
|
412
|
+
/***/ 163:
|
|
413
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
417
|
+
const lib_1 = __webpack_require__(60337);
|
|
418
|
+
const FILE_URL = 'https://www.wordgamedictionary.com/twl06/download/twl06.txt';
|
|
419
|
+
const getEnUsWordList = async () => {
|
|
420
|
+
return (0, lib_1.getTxtWordList)(FILE_URL);
|
|
421
|
+
};
|
|
422
|
+
exports["default"] = getEnUsWordList;
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
/***/ }),
|
|
426
|
+
|
|
427
|
+
/***/ 87537:
|
|
428
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
432
|
+
const lib_1 = __webpack_require__(60337);
|
|
433
|
+
const FILE_URL = 'https://raw.githubusercontent.com/kamilmielnik/fise-2/master/fise-2.txt';
|
|
434
|
+
const getEsEsWordList = async () => {
|
|
435
|
+
const words = await (0, lib_1.getTxtWordList)(FILE_URL);
|
|
436
|
+
return words.map(normalizeWord);
|
|
437
|
+
};
|
|
438
|
+
const normalizeWord = (word) => {
|
|
439
|
+
// normalization from https://stackoverflow.com/a/37511463
|
|
440
|
+
return word.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
441
|
+
};
|
|
442
|
+
exports["default"] = getEsEsWordList;
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
/***/ }),
|
|
446
|
+
|
|
447
|
+
/***/ 27098:
|
|
448
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
452
|
+
const lib_1 = __webpack_require__(60337);
|
|
453
|
+
const FILE_URL =
|
|
454
|
+
// eslint-disable-next-line max-len
|
|
455
|
+
'https://raw.githubusercontent.com/hbenbel/French-Dictionary/a573eab10cc798d7d5da7daab4d2ac0259bb46a3/dictionary/dictionary.txt';
|
|
456
|
+
const getFrFrWordList = async () => {
|
|
457
|
+
const words = await (0, lib_1.getTxtWordList)(FILE_URL);
|
|
458
|
+
return words.map(normalizeWord);
|
|
459
|
+
};
|
|
460
|
+
const normalizeWord = (word) => {
|
|
461
|
+
// normalization from https://stackoverflow.com/a/37511463
|
|
462
|
+
return word.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
463
|
+
};
|
|
464
|
+
exports["default"] = getFrFrWordList;
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
/***/ }),
|
|
468
|
+
|
|
469
|
+
/***/ 81848:
|
|
470
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
474
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
475
|
+
};
|
|
476
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
477
|
+
const cheerio_1 = __importDefault(__webpack_require__(55473));
|
|
478
|
+
const memfs_1 = __webpack_require__(28098);
|
|
479
|
+
const unzipper_1 = __importDefault(__webpack_require__(23428));
|
|
480
|
+
const url_1 = __webpack_require__(57310);
|
|
481
|
+
const lib_1 = __webpack_require__(60337);
|
|
482
|
+
const PAGE_URL = 'https://sjp.pl/sl/growy/';
|
|
483
|
+
const FILE_TO_EXTRACT_FROM_ZIP = 'slowa.txt';
|
|
484
|
+
const getPlPlWordList = async () => {
|
|
485
|
+
const tempFilename = (0, lib_1.getTempFilename)();
|
|
486
|
+
const zipUrl = await fetchZipUrl(PAGE_URL);
|
|
487
|
+
const zipTempFilename = await (0, lib_1.downloadFile)(zipUrl);
|
|
488
|
+
await unzip(zipTempFilename, tempFilename);
|
|
489
|
+
memfs_1.fs.unlinkSync(zipTempFilename);
|
|
490
|
+
const file = memfs_1.fs.readFileSync(tempFilename, 'utf-8');
|
|
491
|
+
memfs_1.fs.unlinkSync(tempFilename);
|
|
492
|
+
const words = (0, lib_1.extractWords)(file.toLocaleString());
|
|
493
|
+
return words;
|
|
494
|
+
};
|
|
495
|
+
const fetchZipUrl = async (url) => {
|
|
496
|
+
const html = await (0, lib_1.downloadHtml)(url);
|
|
497
|
+
const filename = await parseZipContainingPage(html);
|
|
498
|
+
const { href } = new url_1.URL(filename, url);
|
|
499
|
+
return href;
|
|
500
|
+
};
|
|
501
|
+
const parseZipContainingPage = (html) => {
|
|
502
|
+
const $ = cheerio_1.default.load(html);
|
|
503
|
+
const $links = $('a');
|
|
504
|
+
const links = Array.from($links)
|
|
505
|
+
.map((link) => $(link).attr('href'))
|
|
506
|
+
.filter(Boolean);
|
|
507
|
+
const zipFilename = links.find((link) => link.endsWith('.zip'));
|
|
508
|
+
if (typeof zipFilename === 'undefined') {
|
|
509
|
+
throw new Error('Cannot find link to zip file on the page');
|
|
510
|
+
}
|
|
511
|
+
return zipFilename;
|
|
512
|
+
};
|
|
513
|
+
const unzip = (zipFilename, outputFilename) => {
|
|
514
|
+
return memfs_1.fs
|
|
515
|
+
.createReadStream(zipFilename)
|
|
516
|
+
.pipe(unzipper_1.default.Parse())
|
|
517
|
+
.on('entry', (entry) => {
|
|
518
|
+
const fileName = entry.path;
|
|
519
|
+
if (fileName === FILE_TO_EXTRACT_FROM_ZIP) {
|
|
520
|
+
entry.pipe(memfs_1.fs.createWriteStream(outputFilename));
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
entry.autodrain();
|
|
524
|
+
}
|
|
525
|
+
})
|
|
526
|
+
.promise();
|
|
527
|
+
};
|
|
528
|
+
exports["default"] = getPlPlWordList;
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
/***/ }),
|
|
532
|
+
|
|
533
|
+
/***/ 8769:
|
|
534
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
538
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
539
|
+
};
|
|
540
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
541
|
+
const types_1 = __webpack_require__(46452);
|
|
542
|
+
const getDeDeWordList_1 = __importDefault(__webpack_require__(61704));
|
|
543
|
+
const getEnGbWordList_1 = __importDefault(__webpack_require__(3284));
|
|
544
|
+
const getEnUsWordList_1 = __importDefault(__webpack_require__(163));
|
|
545
|
+
const getEsEsWordList_1 = __importDefault(__webpack_require__(87537));
|
|
546
|
+
const getFrFrWordList_1 = __importDefault(__webpack_require__(27098));
|
|
547
|
+
const getPlPlWordList_1 = __importDefault(__webpack_require__(81848));
|
|
548
|
+
const localeMap = {
|
|
549
|
+
[types_1.Locale.DE_DE]: getDeDeWordList_1.default,
|
|
550
|
+
[types_1.Locale.EN_GB]: getEnGbWordList_1.default,
|
|
551
|
+
[types_1.Locale.EN_US]: getEnUsWordList_1.default,
|
|
552
|
+
[types_1.Locale.ES_ES]: getEsEsWordList_1.default,
|
|
553
|
+
[types_1.Locale.FR_FR]: getFrFrWordList_1.default,
|
|
554
|
+
[types_1.Locale.PL_PL]: getPlPlWordList_1.default,
|
|
555
|
+
};
|
|
556
|
+
const getWordList = (locale) => localeMap[locale]();
|
|
557
|
+
exports["default"] = getWordList;
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
/***/ }),
|
|
561
|
+
|
|
562
|
+
/***/ 51585:
|
|
563
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
567
|
+
if (k2 === undefined) k2 = k;
|
|
568
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
569
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
570
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
571
|
+
}
|
|
572
|
+
Object.defineProperty(o, k2, desc);
|
|
573
|
+
}) : (function(o, m, k, k2) {
|
|
574
|
+
if (k2 === undefined) k2 = k;
|
|
575
|
+
o[k2] = m[k];
|
|
576
|
+
}));
|
|
577
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
578
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
579
|
+
};
|
|
580
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
581
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
582
|
+
};
|
|
583
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
584
|
+
exports.getWordList = exports.getDeDeWordList = exports.getPlPlWordList = exports.getFrFrWordList = exports.getEnGbWordList = exports.getEnUsWordList = void 0;
|
|
585
|
+
var getEnUsWordList_1 = __webpack_require__(163);
|
|
586
|
+
Object.defineProperty(exports, "getEnUsWordList", ({ enumerable: true, get: function () { return __importDefault(getEnUsWordList_1).default; } }));
|
|
587
|
+
var getEnGbWordList_1 = __webpack_require__(3284);
|
|
588
|
+
Object.defineProperty(exports, "getEnGbWordList", ({ enumerable: true, get: function () { return __importDefault(getEnGbWordList_1).default; } }));
|
|
589
|
+
var getFrFrWordList_1 = __webpack_require__(27098);
|
|
590
|
+
Object.defineProperty(exports, "getFrFrWordList", ({ enumerable: true, get: function () { return __importDefault(getFrFrWordList_1).default; } }));
|
|
591
|
+
var getPlPlWordList_1 = __webpack_require__(81848);
|
|
592
|
+
Object.defineProperty(exports, "getPlPlWordList", ({ enumerable: true, get: function () { return __importDefault(getPlPlWordList_1).default; } }));
|
|
593
|
+
var getDeDeWordList_1 = __webpack_require__(61704);
|
|
594
|
+
Object.defineProperty(exports, "getDeDeWordList", ({ enumerable: true, get: function () { return __importDefault(getDeDeWordList_1).default; } }));
|
|
595
|
+
var getWordList_1 = __webpack_require__(8769);
|
|
596
|
+
Object.defineProperty(exports, "getWordList", ({ enumerable: true, get: function () { return __importDefault(getWordList_1).default; } }));
|
|
597
|
+
__exportStar(__webpack_require__(60337), exports);
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
/***/ }),
|
|
601
|
+
|
|
602
|
+
/***/ 920:
|
|
603
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
607
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
608
|
+
};
|
|
609
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
610
|
+
const follow_redirects_1 = __webpack_require__(24396);
|
|
611
|
+
const memfs_1 = __webpack_require__(28098);
|
|
612
|
+
const getTempFilename_1 = __importDefault(__webpack_require__(52688));
|
|
613
|
+
const downloadFile = (url) => {
|
|
614
|
+
return new Promise((resolve, reject) => {
|
|
615
|
+
const tempFilename = (0, getTempFilename_1.default)();
|
|
616
|
+
const protocol = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
|
|
617
|
+
const writeStream = memfs_1.fs.createWriteStream(tempFilename);
|
|
618
|
+
const request = protocol.get(url, (response) => {
|
|
619
|
+
if (typeof response.statusCode === 'undefined' || response.statusCode >= 400) {
|
|
620
|
+
reject(new Error(`Cannot download file: ${url}`));
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
response.on('error', (error) => {
|
|
624
|
+
writeStream.close();
|
|
625
|
+
reject(error);
|
|
626
|
+
});
|
|
627
|
+
response.on('end', () => {
|
|
628
|
+
writeStream.on('finish', () => {
|
|
629
|
+
writeStream.close();
|
|
630
|
+
resolve(tempFilename);
|
|
631
|
+
});
|
|
632
|
+
});
|
|
633
|
+
response.pipe(writeStream);
|
|
634
|
+
});
|
|
635
|
+
request.on('error', (error) => {
|
|
636
|
+
writeStream.close();
|
|
637
|
+
reject(error);
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
exports["default"] = downloadFile;
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
/***/ }),
|
|
645
|
+
|
|
646
|
+
/***/ 78015:
|
|
647
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
651
|
+
const follow_redirects_1 = __webpack_require__(24396);
|
|
652
|
+
const downloadHtml = (url) => {
|
|
653
|
+
return new Promise((resolve, reject) => {
|
|
654
|
+
const protocol = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
|
|
655
|
+
protocol.get(url, (response) => {
|
|
656
|
+
let data = '';
|
|
657
|
+
response.setEncoding('utf8');
|
|
658
|
+
response.on('data', (chunk) => {
|
|
659
|
+
data += chunk;
|
|
660
|
+
});
|
|
661
|
+
response.on('end', () => {
|
|
662
|
+
resolve(data);
|
|
663
|
+
});
|
|
664
|
+
response.on('error', reject);
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
exports["default"] = downloadHtml;
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
/***/ }),
|
|
672
|
+
|
|
673
|
+
/***/ 39759:
|
|
674
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
678
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
679
|
+
};
|
|
680
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
681
|
+
const findFirstWordIndex_1 = __importDefault(__webpack_require__(47669));
|
|
682
|
+
const extractWords = (file) => {
|
|
683
|
+
const lines = file.replace(/\r/g, '').split('\n');
|
|
684
|
+
const firstWordIndex = (0, findFirstWordIndex_1.default)(lines);
|
|
685
|
+
const words = lines
|
|
686
|
+
.slice(firstWordIndex)
|
|
687
|
+
.filter((word) => word.trim().length > 0)
|
|
688
|
+
.map((word) => word.toLocaleLowerCase());
|
|
689
|
+
return words;
|
|
690
|
+
};
|
|
691
|
+
exports["default"] = extractWords;
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
/***/ }),
|
|
695
|
+
|
|
696
|
+
/***/ 47669:
|
|
697
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
701
|
+
const findFirstWordIndex = (lines) => {
|
|
702
|
+
const firstWordIndex = lines.findIndex((line, index) => {
|
|
703
|
+
const nextLine = line[index + 1] || '';
|
|
704
|
+
const isNextLineInOrder = line.localeCompare(nextLine) === 1;
|
|
705
|
+
const hasWhitespace = Boolean(line.match(/\s/));
|
|
706
|
+
const isEmpty = line.trim().length === 0;
|
|
707
|
+
return !isEmpty && !hasWhitespace && isNextLineInOrder;
|
|
708
|
+
});
|
|
709
|
+
if (typeof firstWordIndex === 'undefined') {
|
|
710
|
+
throw new Error('Cannot find index of the first word in the file');
|
|
711
|
+
}
|
|
712
|
+
return firstWordIndex;
|
|
713
|
+
};
|
|
714
|
+
exports["default"] = findFirstWordIndex;
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
/***/ }),
|
|
718
|
+
|
|
719
|
+
/***/ 93938:
|
|
720
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
724
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
725
|
+
};
|
|
726
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
727
|
+
const crypto_1 = __importDefault(__webpack_require__(6113));
|
|
728
|
+
const getHash = (bytes = 8) => crypto_1.default.randomBytes(bytes).toString('hex');
|
|
729
|
+
exports["default"] = getHash;
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
/***/ }),
|
|
733
|
+
|
|
734
|
+
/***/ 52688:
|
|
735
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
739
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
740
|
+
};
|
|
741
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
742
|
+
const getHash_1 = __importDefault(__webpack_require__(93938));
|
|
743
|
+
const getTempFilename = () => {
|
|
744
|
+
return `/${(0, getHash_1.default)()}.txt`;
|
|
745
|
+
};
|
|
746
|
+
exports["default"] = getTempFilename;
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
/***/ }),
|
|
750
|
+
|
|
751
|
+
/***/ 78029:
|
|
752
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
756
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
757
|
+
};
|
|
758
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
759
|
+
const memfs_1 = __webpack_require__(28098);
|
|
760
|
+
const downloadFile_1 = __importDefault(__webpack_require__(920));
|
|
761
|
+
const extractWords_1 = __importDefault(__webpack_require__(39759));
|
|
762
|
+
const getTxtWordList = async (url) => {
|
|
763
|
+
const tempFilename = await (0, downloadFile_1.default)(url);
|
|
764
|
+
const file = memfs_1.fs.readFileSync(tempFilename, 'utf-8');
|
|
765
|
+
const words = (0, extractWords_1.default)(file.toLocaleString());
|
|
766
|
+
memfs_1.fs.unlinkSync(tempFilename);
|
|
767
|
+
return words;
|
|
768
|
+
};
|
|
769
|
+
exports["default"] = getTxtWordList;
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
/***/ }),
|
|
773
|
+
|
|
774
|
+
/***/ 60337:
|
|
775
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
779
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
780
|
+
};
|
|
781
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
782
|
+
exports.getTxtWordList = exports.getTempFilename = exports.getHash = exports.findFirstWordIndex = exports.extractWords = exports.downloadHtml = exports.downloadFile = void 0;
|
|
783
|
+
var downloadFile_1 = __webpack_require__(920);
|
|
784
|
+
Object.defineProperty(exports, "downloadFile", ({ enumerable: true, get: function () { return __importDefault(downloadFile_1).default; } }));
|
|
785
|
+
var downloadHtml_1 = __webpack_require__(78015);
|
|
786
|
+
Object.defineProperty(exports, "downloadHtml", ({ enumerable: true, get: function () { return __importDefault(downloadHtml_1).default; } }));
|
|
787
|
+
var extractWords_1 = __webpack_require__(39759);
|
|
788
|
+
Object.defineProperty(exports, "extractWords", ({ enumerable: true, get: function () { return __importDefault(extractWords_1).default; } }));
|
|
789
|
+
var findFirstWordIndex_1 = __webpack_require__(47669);
|
|
790
|
+
Object.defineProperty(exports, "findFirstWordIndex", ({ enumerable: true, get: function () { return __importDefault(findFirstWordIndex_1).default; } }));
|
|
791
|
+
var getHash_1 = __webpack_require__(93938);
|
|
792
|
+
Object.defineProperty(exports, "getHash", ({ enumerable: true, get: function () { return __importDefault(getHash_1).default; } }));
|
|
793
|
+
var getTempFilename_1 = __webpack_require__(52688);
|
|
794
|
+
Object.defineProperty(exports, "getTempFilename", ({ enumerable: true, get: function () { return __importDefault(getTempFilename_1).default; } }));
|
|
795
|
+
var getTxtWordList_1 = __webpack_require__(78029);
|
|
796
|
+
Object.defineProperty(exports, "getTxtWordList", ({ enumerable: true, get: function () { return __importDefault(getTxtWordList_1).default; } }));
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
/***/ })
|
|
800
|
+
|
|
801
|
+
};
|
|
802
|
+
;
|