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.
@@ -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
- var _a;
33
- _nodePath = _nodePath !== null && _nodePath !== void 0 ? _nodePath : Path;
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 = (_a = options.nodePath) !== null && _a !== void 0 ? _a : _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 };
@@ -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 = (_a = fileOrGlob.root) !== null && _a !== void 0 ? _a : root;
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: (_a = g.root) !== null && _a !== void 0 ? _a : 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.2",
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": "^17.0.40",
49
+ "@types/node": "^18.0.0",
50
50
  "jest": "^28.1.1",
51
51
  "rimraf": "^3.0.2"
52
52
  },
53
- "gitHead": "5ef579108a81bf7206cf53e301374467a3bbde06"
53
+ "gitHead": "e96b313542f2ec0a38ac04d1422d97e724ded3a6"
54
54
  }