cspell-lib 6.31.0 → 6.31.2
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/dist/cjs/Cache/cspell.cache.js +1 -1
- package/dist/cjs/Settings/CSpellSettingsServer.js +15 -21
- package/dist/cjs/textValidation/checkText.js +1 -1
- package/dist/cjs/util/util.d.ts +1 -1
- package/dist/cjs/util/util.js +2 -2
- package/dist/esm/Settings/CSpellSettingsServer.mjs +15 -21
- package/dist/esm/util/util.d.mts +1 -1
- package/dist/esm/util/util.mjs +2 -2
- package/package.json +12 -12
|
@@ -11,5 +11,5 @@ var IssueCode;
|
|
|
11
11
|
IssueCode[IssueCode["ForbiddenWord"] = 2] = "ForbiddenWord";
|
|
12
12
|
IssueCode[IssueCode["KnownIssue"] = 4] = "KnownIssue";
|
|
13
13
|
IssueCode[IssueCode["ALL"] = 7] = "ALL";
|
|
14
|
-
})(IssueCode
|
|
14
|
+
})(IssueCode || (exports.IssueCode = IssueCode = {}));
|
|
15
15
|
//# sourceMappingURL=cspell.cache.js.map
|
|
@@ -36,24 +36,21 @@ const util = __importStar(require("../util/util.js"));
|
|
|
36
36
|
const constants_js_1 = require("./constants.js");
|
|
37
37
|
const DictionarySettings_js_1 = require("./DictionarySettings.js");
|
|
38
38
|
const patterns_js_1 = require("./patterns.js");
|
|
39
|
-
function _unique(a) {
|
|
40
|
-
return [...new Set(a)];
|
|
41
|
-
}
|
|
42
39
|
function mergeListUnique(left, right) {
|
|
43
|
-
if (left
|
|
44
|
-
return right;
|
|
45
|
-
if (right
|
|
40
|
+
if (!Array.isArray(left))
|
|
41
|
+
return Array.isArray(right) ? right : undefined;
|
|
42
|
+
if (!Array.isArray(right))
|
|
46
43
|
return left;
|
|
47
44
|
if (!right.length)
|
|
48
45
|
return left;
|
|
49
46
|
if (!left.length)
|
|
50
47
|
return right;
|
|
51
|
-
return
|
|
48
|
+
return [...new Set([...left, ...right])];
|
|
52
49
|
}
|
|
53
50
|
function mergeList(left, right) {
|
|
54
|
-
if (left
|
|
55
|
-
return right;
|
|
56
|
-
if (right
|
|
51
|
+
if (!Array.isArray(left))
|
|
52
|
+
return Array.isArray(right) ? right : undefined;
|
|
53
|
+
if (!Array.isArray(right))
|
|
57
54
|
return left;
|
|
58
55
|
if (!left.length)
|
|
59
56
|
return right;
|
|
@@ -69,20 +66,17 @@ function _mergeWordsCached(left, right) {
|
|
|
69
66
|
return (0, AutoResolve_js_1.autoResolveWeak)(map, right, () => left.concat(right));
|
|
70
67
|
}
|
|
71
68
|
function mergeWordsCached(left, right) {
|
|
72
|
-
if (left
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return !right || right.length ? right : emptyWords;
|
|
78
|
-
if (!right.length)
|
|
79
|
-
return !left || left.length ? left : emptyWords;
|
|
69
|
+
if (!Array.isArray(left) || !left.length) {
|
|
70
|
+
return Array.isArray(right) ? (right.length ? right : emptyWords) : undefined;
|
|
71
|
+
}
|
|
72
|
+
if (!Array.isArray(right) || !right.length)
|
|
73
|
+
return left;
|
|
80
74
|
return _mergeWordsCached(left, right);
|
|
81
75
|
}
|
|
82
76
|
function mergeObjects(left, right) {
|
|
83
|
-
if (left
|
|
84
|
-
return right;
|
|
85
|
-
if (right
|
|
77
|
+
if (!left || typeof left !== 'object')
|
|
78
|
+
return !right || typeof right !== 'object' ? undefined : right;
|
|
79
|
+
if (!right || typeof right !== 'object')
|
|
86
80
|
return left;
|
|
87
81
|
return { ...left, ...right };
|
|
88
82
|
}
|
|
@@ -72,7 +72,7 @@ var IncludeExcludeFlag;
|
|
|
72
72
|
(function (IncludeExcludeFlag) {
|
|
73
73
|
IncludeExcludeFlag["INCLUDE"] = "I";
|
|
74
74
|
IncludeExcludeFlag["EXCLUDE"] = "E";
|
|
75
|
-
})(IncludeExcludeFlag
|
|
75
|
+
})(IncludeExcludeFlag || (exports.IncludeExcludeFlag = IncludeExcludeFlag = {}));
|
|
76
76
|
/**
|
|
77
77
|
* Calculate document issues and include / exclude zones.
|
|
78
78
|
* @param doc - document to check
|
package/dist/cjs/util/util.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare function uniqueFilterFnGenerator<T>(): (v: T) => boolean;
|
|
|
4
4
|
export declare function uniqueFilterFnGenerator<T, U>(extractFn: (v: T) => U): (v: T) => boolean;
|
|
5
5
|
export declare function unique<T>(src: T[]): T[];
|
|
6
6
|
/**
|
|
7
|
-
* Delete all `undefined` fields from an object.
|
|
7
|
+
* Delete all `undefined` and `null` fields from an object.
|
|
8
8
|
* @param src - object to be cleaned
|
|
9
9
|
*/
|
|
10
10
|
export declare function clean<T extends object>(src: T): RemoveUndefined<T>;
|
package/dist/cjs/util/util.js
CHANGED
|
@@ -19,13 +19,13 @@ function unique(src) {
|
|
|
19
19
|
}
|
|
20
20
|
exports.unique = unique;
|
|
21
21
|
/**
|
|
22
|
-
* Delete all `undefined` fields from an object.
|
|
22
|
+
* Delete all `undefined` and `null` fields from an object.
|
|
23
23
|
* @param src - object to be cleaned
|
|
24
24
|
*/
|
|
25
25
|
function clean(src) {
|
|
26
26
|
const r = src;
|
|
27
27
|
for (const key of Object.keys(r)) {
|
|
28
|
-
if (r[key] === undefined) {
|
|
28
|
+
if (r[key] === undefined || r[key] === null) {
|
|
29
29
|
delete r[key];
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -7,24 +7,21 @@ import * as util from '../util/util.mjs';
|
|
|
7
7
|
import { configSettingsFileVersion0_1, ENV_CSPELL_GLOB_ROOT } from './constants.mjs';
|
|
8
8
|
import { calcDictionaryDefsToLoad, mapDictDefsToInternal } from './DictionarySettings.mjs';
|
|
9
9
|
import { resolvePatterns } from './patterns.mjs';
|
|
10
|
-
function _unique(a) {
|
|
11
|
-
return [...new Set(a)];
|
|
12
|
-
}
|
|
13
10
|
function mergeListUnique(left, right) {
|
|
14
|
-
if (left
|
|
15
|
-
return right;
|
|
16
|
-
if (right
|
|
11
|
+
if (!Array.isArray(left))
|
|
12
|
+
return Array.isArray(right) ? right : undefined;
|
|
13
|
+
if (!Array.isArray(right))
|
|
17
14
|
return left;
|
|
18
15
|
if (!right.length)
|
|
19
16
|
return left;
|
|
20
17
|
if (!left.length)
|
|
21
18
|
return right;
|
|
22
|
-
return
|
|
19
|
+
return [...new Set([...left, ...right])];
|
|
23
20
|
}
|
|
24
21
|
function mergeList(left, right) {
|
|
25
|
-
if (left
|
|
26
|
-
return right;
|
|
27
|
-
if (right
|
|
22
|
+
if (!Array.isArray(left))
|
|
23
|
+
return Array.isArray(right) ? right : undefined;
|
|
24
|
+
if (!Array.isArray(right))
|
|
28
25
|
return left;
|
|
29
26
|
if (!left.length)
|
|
30
27
|
return right;
|
|
@@ -40,20 +37,17 @@ function _mergeWordsCached(left, right) {
|
|
|
40
37
|
return autoResolveWeak(map, right, () => left.concat(right));
|
|
41
38
|
}
|
|
42
39
|
function mergeWordsCached(left, right) {
|
|
43
|
-
if (left
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return !right || right.length ? right : emptyWords;
|
|
49
|
-
if (!right.length)
|
|
50
|
-
return !left || left.length ? left : emptyWords;
|
|
40
|
+
if (!Array.isArray(left) || !left.length) {
|
|
41
|
+
return Array.isArray(right) ? (right.length ? right : emptyWords) : undefined;
|
|
42
|
+
}
|
|
43
|
+
if (!Array.isArray(right) || !right.length)
|
|
44
|
+
return left;
|
|
51
45
|
return _mergeWordsCached(left, right);
|
|
52
46
|
}
|
|
53
47
|
function mergeObjects(left, right) {
|
|
54
|
-
if (left
|
|
55
|
-
return right;
|
|
56
|
-
if (right
|
|
48
|
+
if (!left || typeof left !== 'object')
|
|
49
|
+
return !right || typeof right !== 'object' ? undefined : right;
|
|
50
|
+
if (!right || typeof right !== 'object')
|
|
57
51
|
return left;
|
|
58
52
|
return { ...left, ...right };
|
|
59
53
|
}
|
package/dist/esm/util/util.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ export declare function uniqueFilterFnGenerator<T>(): (v: T) => boolean;
|
|
|
4
4
|
export declare function uniqueFilterFnGenerator<T, U>(extractFn: (v: T) => U): (v: T) => boolean;
|
|
5
5
|
export declare function unique<T>(src: T[]): T[];
|
|
6
6
|
/**
|
|
7
|
-
* Delete all `undefined` fields from an object.
|
|
7
|
+
* Delete all `undefined` and `null` fields from an object.
|
|
8
8
|
* @param src - object to be cleaned
|
|
9
9
|
*/
|
|
10
10
|
export declare function clean<T extends object>(src: T): RemoveUndefined<T>;
|
package/dist/esm/util/util.mjs
CHANGED
|
@@ -14,13 +14,13 @@ export function unique(src) {
|
|
|
14
14
|
return [...new Set(src)];
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Delete all `undefined` fields from an object.
|
|
17
|
+
* Delete all `undefined` and `null` fields from an object.
|
|
18
18
|
* @param src - object to be cleaned
|
|
19
19
|
*/
|
|
20
20
|
export function clean(src) {
|
|
21
21
|
const r = src;
|
|
22
22
|
for (const key of Object.keys(r)) {
|
|
23
|
-
if (r[key] === undefined) {
|
|
23
|
+
if (r[key] === undefined || r[key] === null) {
|
|
24
24
|
delete r[key];
|
|
25
25
|
}
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-lib",
|
|
3
|
-
"version": "6.31.
|
|
3
|
+
"version": "6.31.2",
|
|
4
4
|
"description": "A library of useful functions used across various cspell tools.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@cspell/cspell-bundled-dicts": "6.31.
|
|
61
|
-
"@cspell/cspell-pipe": "6.31.
|
|
62
|
-
"@cspell/cspell-types": "6.31.
|
|
63
|
-
"@cspell/strong-weak-map": "6.31.
|
|
60
|
+
"@cspell/cspell-bundled-dicts": "6.31.2",
|
|
61
|
+
"@cspell/cspell-pipe": "6.31.1",
|
|
62
|
+
"@cspell/cspell-types": "6.31.1",
|
|
63
|
+
"@cspell/strong-weak-map": "6.31.1",
|
|
64
64
|
"clear-module": "^4.1.2",
|
|
65
65
|
"comment-json": "^4.2.3",
|
|
66
66
|
"configstore": "^5.0.1",
|
|
67
67
|
"cosmiconfig": "8.0.0",
|
|
68
|
-
"cspell-dictionary": "6.31.
|
|
69
|
-
"cspell-glob": "6.31.
|
|
70
|
-
"cspell-grammar": "6.31.
|
|
71
|
-
"cspell-io": "6.31.
|
|
72
|
-
"cspell-trie-lib": "6.31.
|
|
68
|
+
"cspell-dictionary": "6.31.1",
|
|
69
|
+
"cspell-glob": "6.31.2",
|
|
70
|
+
"cspell-grammar": "6.31.1",
|
|
71
|
+
"cspell-io": "6.31.2",
|
|
72
|
+
"cspell-trie-lib": "6.31.1",
|
|
73
73
|
"fast-equals": "^4.0.3",
|
|
74
74
|
"find-up": "^5.0.0",
|
|
75
75
|
"gensequence": "^5.0.2",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"expect": "^29.5.0",
|
|
98
98
|
"jest": "^29.5.0",
|
|
99
99
|
"lorem-ipsum": "^2.0.8",
|
|
100
|
-
"ts-jest": "^29.0
|
|
100
|
+
"ts-jest": "^29.1.0"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "aa78fdb9d4fc45dc74bcf31b6a6366784fe0d1c4"
|
|
103
103
|
}
|