cspell-lib 8.8.2 → 8.8.4
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.
|
@@ -40,11 +40,13 @@ export declare function normalizeLanguageSettings(languageSettings: LanguageSett
|
|
|
40
40
|
type NormalizeGitignoreRoot = Pick<CSpellUserSettings, 'gitignoreRoot'>;
|
|
41
41
|
export declare function normalizeGitignoreRoot(settings: NormalizeGitignoreRoot, pathToSettingsFile: URL): NormalizeGitignoreRoot;
|
|
42
42
|
interface NormalizeSettingsGlobs {
|
|
43
|
+
files?: CSpellUserSettings['files'];
|
|
43
44
|
globRoot?: CSpellUserSettings['globRoot'];
|
|
44
45
|
ignorePaths?: CSpellUserSettings['ignorePaths'];
|
|
45
46
|
}
|
|
46
47
|
interface NormalizeSettingsGlobsResult {
|
|
47
48
|
ignorePaths?: GlobDef[];
|
|
49
|
+
files?: GlobDef[];
|
|
48
50
|
}
|
|
49
51
|
export declare function normalizeSettingsGlobs(settings: NormalizeSettingsGlobs, pathToSettingsFile: URL): NormalizeSettingsGlobsResult;
|
|
50
52
|
export declare function normalizeCacheSettings(settings: Pick<CSpellUserSettings, 'cache'>, pathToSettingsFile: URL): Pick<CSpellUserSettings, 'cache'>;
|
|
@@ -85,12 +85,14 @@ export function normalizeGitignoreRoot(settings, pathToSettingsFile) {
|
|
|
85
85
|
}
|
|
86
86
|
export function normalizeSettingsGlobs(settings, pathToSettingsFile) {
|
|
87
87
|
const { globRoot } = settings;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
const normalized = {};
|
|
89
|
+
if (settings.ignorePaths) {
|
|
90
|
+
normalized.ignorePaths = toGlobDef(settings.ignorePaths, globRoot, toFilePathOrHref(pathToSettingsFile));
|
|
91
|
+
}
|
|
92
|
+
if (settings.files) {
|
|
93
|
+
normalized.files = toGlobDef(settings.files, globRoot, toFilePathOrHref(pathToSettingsFile));
|
|
94
|
+
}
|
|
95
|
+
return normalized;
|
|
94
96
|
}
|
|
95
97
|
export function normalizeCacheSettings(settings, pathToSettingsFile) {
|
|
96
98
|
const { cache } = settings;
|
package/dist/esm/util/Uri.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import assert from 'node:assert';
|
|
2
|
+
import { isUrlLike } from 'cspell-io';
|
|
2
3
|
import { URI, Utils } from 'vscode-uri';
|
|
3
4
|
const isFile = /^(?:[a-zA-Z]:|[/\\])/;
|
|
4
5
|
const isPossibleUri = /\w:\/\//;
|
|
5
|
-
const isUrl = /^(file:|stdin:|https?:|s?ftp:)/;
|
|
6
6
|
const STDIN_PROTOCOL = 'stdin:';
|
|
7
7
|
export function toUri(uriOrFile) {
|
|
8
8
|
if (UriImpl.isUri(uriOrFile))
|
|
@@ -11,11 +11,11 @@ export function toUri(uriOrFile) {
|
|
|
11
11
|
return UriImpl.from(uriOrFile);
|
|
12
12
|
if (uriOrFile instanceof URL)
|
|
13
13
|
return UriImpl.parse(uriOrFile.toString());
|
|
14
|
-
if (
|
|
14
|
+
if (isHRef(uriOrFile))
|
|
15
15
|
return UriImpl.parse(uriOrFile.href);
|
|
16
16
|
if (isUri(uriOrFile))
|
|
17
17
|
return UriImpl.from(uriOrFile);
|
|
18
|
-
if (
|
|
18
|
+
if (isUrlLike(uriOrFile))
|
|
19
19
|
return UriImpl.parse(uriOrFile);
|
|
20
20
|
return isFile.test(uriOrFile) && !isPossibleUri.test(uriOrFile)
|
|
21
21
|
? UriImpl.file(normalizeDriveLetter(uriOrFile))
|
|
@@ -39,7 +39,7 @@ export function parse(uri) {
|
|
|
39
39
|
export function normalizeDriveLetter(path) {
|
|
40
40
|
return hasDriveLetter.test(path) ? path[0].toLowerCase() + path.slice(1) : path;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function isHRef(url) {
|
|
43
43
|
return (!!url && typeof url === 'object' && typeof url.href === 'string') || false;
|
|
44
44
|
}
|
|
45
45
|
export function isUri(uri) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-lib",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.4",
|
|
4
4
|
"description": "A library of useful functions used across various cspell tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -59,20 +59,20 @@
|
|
|
59
59
|
},
|
|
60
60
|
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cspell/cspell-bundled-dicts": "8.8.
|
|
63
|
-
"@cspell/cspell-pipe": "8.8.
|
|
64
|
-
"@cspell/cspell-resolver": "8.8.
|
|
65
|
-
"@cspell/cspell-types": "8.8.
|
|
66
|
-
"@cspell/dynamic-import": "8.8.
|
|
67
|
-
"@cspell/strong-weak-map": "8.8.
|
|
62
|
+
"@cspell/cspell-bundled-dicts": "8.8.4",
|
|
63
|
+
"@cspell/cspell-pipe": "8.8.4",
|
|
64
|
+
"@cspell/cspell-resolver": "8.8.4",
|
|
65
|
+
"@cspell/cspell-types": "8.8.4",
|
|
66
|
+
"@cspell/dynamic-import": "8.8.4",
|
|
67
|
+
"@cspell/strong-weak-map": "8.8.4",
|
|
68
68
|
"clear-module": "^4.1.2",
|
|
69
69
|
"comment-json": "^4.2.3",
|
|
70
|
-
"cspell-config-lib": "8.8.
|
|
71
|
-
"cspell-dictionary": "8.8.
|
|
72
|
-
"cspell-glob": "8.8.
|
|
73
|
-
"cspell-grammar": "8.8.
|
|
74
|
-
"cspell-io": "8.8.
|
|
75
|
-
"cspell-trie-lib": "8.8.
|
|
70
|
+
"cspell-config-lib": "8.8.4",
|
|
71
|
+
"cspell-dictionary": "8.8.4",
|
|
72
|
+
"cspell-glob": "8.8.4",
|
|
73
|
+
"cspell-grammar": "8.8.4",
|
|
74
|
+
"cspell-io": "8.8.4",
|
|
75
|
+
"cspell-trie-lib": "8.8.4",
|
|
76
76
|
"env-paths": "^3.0.0",
|
|
77
77
|
"fast-equals": "^5.0.1",
|
|
78
78
|
"gensequence": "^7.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"node": ">=18"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@cspell/dict-cpp": "^5.1.
|
|
89
|
+
"@cspell/dict-cpp": "^5.1.8",
|
|
90
90
|
"@cspell/dict-csharp": "^4.0.2",
|
|
91
91
|
"@cspell/dict-css": "^4.0.12",
|
|
92
92
|
"@cspell/dict-fa-ir": "^4.0.0",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"leaked-handles": "^5.2.0",
|
|
101
101
|
"lorem-ipsum": "^2.0.8"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "e1df92825ed0dacedb1830eeb6d918f01690c69a"
|
|
104
104
|
}
|