cspell-glob 6.1.2 → 6.1.3
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/GlobMatcher.js +3 -4
- package/dist/globHelper.js +2 -4
- package/package.json +3 -3
package/dist/GlobMatcher.js
CHANGED
|
@@ -29,12 +29,11 @@ const Path = __importStar(require("path"));
|
|
|
29
29
|
const globHelper_1 = require("./globHelper");
|
|
30
30
|
class GlobMatcher {
|
|
31
31
|
constructor(patterns, rootOrOptions, _nodePath) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const options = typeof rootOrOptions === 'string' ? { root: rootOrOptions } : rootOrOptions !== null && rootOrOptions !== void 0 ? rootOrOptions : {};
|
|
32
|
+
_nodePath = _nodePath ?? Path;
|
|
33
|
+
const options = typeof rootOrOptions === 'string' ? { root: rootOrOptions } : rootOrOptions ?? {};
|
|
35
34
|
const { mode = 'exclude' } = options;
|
|
36
35
|
const isExcludeMode = mode !== 'include';
|
|
37
|
-
_nodePath =
|
|
36
|
+
_nodePath = options.nodePath ?? _nodePath;
|
|
38
37
|
const { root = _nodePath.resolve(), dot = isExcludeMode, nodePath = _nodePath, nested = isExcludeMode, cwd = process.cwd(), nobrace, } = clean(options);
|
|
39
38
|
const normalizedRoot = nodePath.resolve(nodePath.normalize(root));
|
|
40
39
|
this.options = { root: normalizedRoot, dot, nodePath, nested, mode, nobrace, cwd };
|
package/dist/globHelper.js
CHANGED
|
@@ -35,10 +35,9 @@ const relRegExp = /^\.[\\/]/;
|
|
|
35
35
|
* @param path - optional node path methods - used for testing
|
|
36
36
|
*/
|
|
37
37
|
function fileOrGlobToGlob(fileOrGlob, root, path = Path) {
|
|
38
|
-
var _a;
|
|
39
38
|
const pathToGlob = path.sep === '\\' ? (p) => p.replace(/\\/g, '/') : (p) => p;
|
|
40
39
|
if (typeof fileOrGlob !== 'string') {
|
|
41
|
-
const useRoot =
|
|
40
|
+
const useRoot = fileOrGlob.root ?? root;
|
|
42
41
|
return { ...fileOrGlob, root: useRoot };
|
|
43
42
|
}
|
|
44
43
|
if (doesRootContainPath(root, fileOrGlob, path) || relRegExp.test(fileOrGlob)) {
|
|
@@ -138,10 +137,9 @@ function normalizeGlobPatterns(patterns, options) {
|
|
|
138
137
|
}
|
|
139
138
|
exports.normalizeGlobPatterns = normalizeGlobPatterns;
|
|
140
139
|
function normalizeGlobPattern(g, options) {
|
|
141
|
-
var _a;
|
|
142
140
|
const { root, nodePath: path = Path, nested, cwd = Path.resolve() } = options;
|
|
143
141
|
g = !isGlobPatternWithOptionalRoot(g) ? { glob: g } : g;
|
|
144
|
-
const gr = { ...g, root:
|
|
142
|
+
const gr = { ...g, root: g.root ?? root };
|
|
145
143
|
const rawRoot = gr.root;
|
|
146
144
|
const rawGlob = g.glob;
|
|
147
145
|
gr.glob = gr.glob.trim(); // trimGlob(g.glob);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-glob",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"description": "Glob matcher for cspell",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cspell",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/micromatch": "^4.0.2",
|
|
49
|
-
"@types/node": "^
|
|
49
|
+
"@types/node": "^18.0.0",
|
|
50
50
|
"jest": "^28.1.1",
|
|
51
51
|
"rimraf": "^3.0.2"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "e96b313542f2ec0a38ac04d1422d97e724ded3a6"
|
|
54
54
|
}
|