knip 0.11.1 → 0.11.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/util/glob.js CHANGED
@@ -13,13 +13,16 @@ const globProxy = async function (patterns, options) {
13
13
  }
14
14
  return _globby(patterns, options);
15
15
  };
16
+ const ensurePosixPath = (value) => value.split(node_path_1.default.sep).join(node_path_1.default.posix.sep);
16
17
  const prependDirToPattern = (workingDir, pattern) => {
17
18
  if (pattern.startsWith('!'))
18
19
  return '!' + node_path_1.default.posix.join(workingDir, pattern.slice(1));
19
20
  return node_path_1.default.posix.join(workingDir, pattern);
20
21
  };
21
22
  const glob = async ({ cwd, workingDir, patterns, ignore, gitignore, }) => {
22
- return globProxy(patterns.map(pattern => prependDirToPattern(node_path_1.default.posix.relative(cwd, workingDir), pattern)), {
23
+ const cwdPosix = ensurePosixPath(cwd);
24
+ const workingDirPosix = ensurePosixPath(workingDir);
25
+ return globProxy(patterns.map(pattern => prependDirToPattern(node_path_1.default.posix.relative(cwdPosix, workingDirPosix), pattern)), {
23
26
  cwd,
24
27
  ignore: [...ignore, '**/node_modules/**'],
25
28
  gitignore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript project",
5
5
  "keywords": [
6
6
  "find",