cspell-lib 10.3.0-alpha.0 → 10.3.0
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.
|
@@ -52,7 +52,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
52
|
});
|
|
53
53
|
import { opConcatMap, opFilter, opMap, pipe } from '@cspell/cspell-pipe/sync';
|
|
54
54
|
import { StrongWeakMap } from '@cspell/strong-weak-map';
|
|
55
|
-
import { createFailedToLoadDictionary, createFlagWordsDictionary, createFlagWordsDictionaryFromTrieFile, createInlineSpellingDictionary, createSpellingDictionary, createSpellingDictionaryFromTrieFile, } from 'cspell-dictionary';
|
|
55
|
+
import { createFailedToLoadDictionary, createFlagWordsDictionary, createFlagWordsDictionaryFromTrieFile, createInlineSpellingDictionary, createSpellingDictionary, createSpellingDictionaryFromTrieFile, createSuggestDictionary, createSuggestDictionaryFromTrieFile, } from 'cspell-dictionary';
|
|
56
56
|
import { compareStats, toFileURL, urlBasename } from 'cspell-io';
|
|
57
57
|
import { measurePerf } from '../../perf/index.js';
|
|
58
58
|
import { isDictionaryDefinitionInlineInternal, isDictionaryFileDefinitionInternal } from '../../Settings/index.js';
|
|
@@ -257,6 +257,9 @@ async function legacyWordList(reader, filename, options) {
|
|
|
257
257
|
if (options.kind === 'flag-words') {
|
|
258
258
|
return createFlagWordsDictionary([...words], options.name, filename.toString());
|
|
259
259
|
}
|
|
260
|
+
if (options.kind === 'suggest-words') {
|
|
261
|
+
return createSuggestDictionary([...words], options.name, filename.toString());
|
|
262
|
+
}
|
|
260
263
|
return createSpellingDictionary(words, options.name, filename.toString(), applyKind(options), true);
|
|
261
264
|
}
|
|
262
265
|
catch (e_1) {
|
|
@@ -277,6 +280,9 @@ async function wordsPerLineWordList(reader, filename, options) {
|
|
|
277
280
|
if (options.kind === 'flag-words') {
|
|
278
281
|
return createFlagWordsDictionary([...words], options.name, filename.href);
|
|
279
282
|
}
|
|
283
|
+
if (options.kind === 'suggest-words') {
|
|
284
|
+
return createSuggestDictionary([...words], options.name, filename.href);
|
|
285
|
+
}
|
|
280
286
|
return createSpellingDictionary(words, options.name, filename.href, applyKind(options), true);
|
|
281
287
|
}
|
|
282
288
|
async function loadSimpleWordList(reader, filename, options) {
|
|
@@ -287,6 +293,9 @@ async function loadSimpleWordList(reader, filename, options) {
|
|
|
287
293
|
if (options.kind === 'flag-words') {
|
|
288
294
|
return createFlagWordsDictionary(lines, options.name, filename.href);
|
|
289
295
|
}
|
|
296
|
+
if (options.kind === 'suggest-words') {
|
|
297
|
+
return createSuggestDictionary(lines, options.name, filename.href);
|
|
298
|
+
}
|
|
290
299
|
return createSpellingDictionary(lines, options.name, filename.href, applyKind(options));
|
|
291
300
|
}
|
|
292
301
|
catch (e_2) {
|
|
@@ -305,6 +314,9 @@ async function loadTrie(reader, filename, options) {
|
|
|
305
314
|
if (options.kind === 'flag-words') {
|
|
306
315
|
return createFlagWordsDictionaryFromTrieFile(content, options.name, filename.href);
|
|
307
316
|
}
|
|
317
|
+
if (options.kind === 'suggest-words') {
|
|
318
|
+
return createSuggestDictionaryFromTrieFile(content, options.name, filename.href);
|
|
319
|
+
}
|
|
308
320
|
return createSpellingDictionaryFromTrieFile(content, options.name, filename.href, applyKind(options));
|
|
309
321
|
}
|
|
310
322
|
catch (e_3) {
|
|
@@ -317,7 +329,8 @@ async function loadTrie(reader, filename, options) {
|
|
|
317
329
|
}
|
|
318
330
|
/**
|
|
319
331
|
* Apply the effect of `kind` on the options passed to a normal `words` dictionary loader.
|
|
320
|
-
* `flag-words`
|
|
332
|
+
* `flag-words` and `suggest-words` are handled by the callers directly since they use a different
|
|
333
|
+
* dictionary implementation.
|
|
321
334
|
*/
|
|
322
335
|
function applyKind(options) {
|
|
323
336
|
return options.kind === 'ignore-words' && !options.noSuggest ? { ...options, noSuggest: true } : options;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
7
|
-
"version": "10.3.0
|
|
7
|
+
"version": "10.3.0",
|
|
8
8
|
"description": "A library of useful functions used across various cspell tools.",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
@@ -75,22 +75,22 @@
|
|
|
75
75
|
},
|
|
76
76
|
"homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-lib#readme",
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@cspell/cspell-bundled-dicts": "10.3.0
|
|
79
|
-
"@cspell/cspell-performance-monitor": "10.3.0
|
|
80
|
-
"@cspell/cspell-pipe": "10.3.0
|
|
81
|
-
"@cspell/cspell-resolver": "10.3.0
|
|
82
|
-
"@cspell/cspell-types": "10.3.0
|
|
83
|
-
"@cspell/dynamic-import": "10.3.0
|
|
84
|
-
"@cspell/filetypes": "10.3.0
|
|
85
|
-
"@cspell/rpc": "10.3.0
|
|
86
|
-
"@cspell/strong-weak-map": "10.3.0
|
|
87
|
-
"@cspell/url": "10.3.0
|
|
88
|
-
"cspell-config-lib": "10.3.0
|
|
89
|
-
"cspell-dictionary": "10.3.0
|
|
90
|
-
"cspell-glob": "10.3.0
|
|
91
|
-
"cspell-grammar": "10.3.0
|
|
92
|
-
"cspell-io": "10.3.0
|
|
93
|
-
"cspell-trie-lib": "10.3.0
|
|
78
|
+
"@cspell/cspell-bundled-dicts": "10.3.0",
|
|
79
|
+
"@cspell/cspell-performance-monitor": "10.3.0",
|
|
80
|
+
"@cspell/cspell-pipe": "10.3.0",
|
|
81
|
+
"@cspell/cspell-resolver": "10.3.0",
|
|
82
|
+
"@cspell/cspell-types": "10.3.0",
|
|
83
|
+
"@cspell/dynamic-import": "10.3.0",
|
|
84
|
+
"@cspell/filetypes": "10.3.0",
|
|
85
|
+
"@cspell/rpc": "10.3.0",
|
|
86
|
+
"@cspell/strong-weak-map": "10.3.0",
|
|
87
|
+
"@cspell/url": "10.3.0",
|
|
88
|
+
"cspell-config-lib": "10.3.0",
|
|
89
|
+
"cspell-dictionary": "10.3.0",
|
|
90
|
+
"cspell-glob": "10.3.0",
|
|
91
|
+
"cspell-grammar": "10.3.0",
|
|
92
|
+
"cspell-io": "10.3.0",
|
|
93
|
+
"cspell-trie-lib": "10.3.0",
|
|
94
94
|
"env-paths": "^4.0.0",
|
|
95
95
|
"gensequence": "^8.0.8",
|
|
96
96
|
"import-fresh": "^4.0.0",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"node": ">=22.18.0"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@cspell/cspell-tools": "10.3.0
|
|
106
|
+
"@cspell/cspell-tools": "10.3.0",
|
|
107
107
|
"@cspell/dict-cpp": "^7.1.0",
|
|
108
108
|
"@cspell/dict-csharp": "^4.0.8",
|
|
109
109
|
"@cspell/dict-css": "^4.1.2",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"lorem-ipsum": "^3.0.0",
|
|
124
124
|
"perf-insight": "^2.0.1"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "d8abd59fa15da6da47955eb6fcca180e8b5cbdbf"
|
|
127
127
|
}
|