rev-dep 1.5.1 → 1.5.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.
@@ -61,7 +61,7 @@ module.exports = function plugin({ types }, { tsConfigPath = (0, utils_1.findTsC
61
61
  console.warn('Cannot resolve import ' + original);
62
62
  return null;
63
63
  }
64
- const path = paths[0];
64
+ const path = node_path.normalize(paths[0]);
65
65
  try {
66
66
  return [path, fs.readFileSync(path).toString()];
67
67
  }
@@ -71,7 +71,7 @@ module.exports = function plugin({ types }, { tsConfigPath = (0, utils_1.findTsC
71
71
  };
72
72
  const shouldPathBeAnalyzed = (path) => {
73
73
  const aliasRegexIdx = aliasesRegexes.findIndex((aliasRegex) => aliasRegex.test(path));
74
- const isRelative = path.startsWith('./') || path.startsWith('../');
74
+ const isRelative = path.startsWith('.');
75
75
  const isAbsolute = path.startsWith('/');
76
76
  const isBaseUrlPath = baseUrlDirs.some((dir) => path.startsWith(dir));
77
77
  return aliasRegexIdx > -1 || isRelative || isAbsolute || isBaseUrlPath;
@@ -229,11 +229,11 @@ module.exports = function plugin({ types }, { tsConfigPath = (0, utils_1.findTsC
229
229
  // we need ../ to skip current file name
230
230
  modulePath = node_path.join(cwd, relativeFileName, '../' + sourcePath);
231
231
  }
232
- return modulePath;
232
+ return node_path.normalize(modulePath);
233
233
  };
234
234
  const getImportKind = (sourcePath) => {
235
235
  const aliasRegexIdx = aliasesRegexes.findIndex((aliasRegex) => aliasRegex.test(sourcePath));
236
- const isRelative = sourcePath.startsWith('./') || sourcePath.startsWith('../');
236
+ const isRelative = sourcePath.startsWith('.');
237
237
  const isBaseUrlPath = baseUrlDirs.some((dir) => sourcePath.startsWith(dir));
238
238
  if (aliasRegexIdx > -1) {
239
239
  return 'aliased';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rev-dep",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Dependency debugging tool for JavaScript and TypeScript projects",
5
5
  "main": "dist/module.js",
6
6
  "bin": "bin.js",