rev-dep 1.0.6 → 1.0.7

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/bin.js CHANGED
File without changes
@@ -1,3 +1,3 @@
1
- import { Command } from './generate';
1
+ import type { Command } from './generate';
2
2
  declare function template(commands: Command[], headerLevel: number): string;
3
3
  export default template;
@@ -33,7 +33,7 @@ function formatResults({ results, filePath, entryPoints, compactSummary }) {
33
33
  let formatted = '';
34
34
  const hasAnyResults = results.some((paths) => paths.length > 0);
35
35
  if (!hasAnyResults) {
36
- formatted = join('No results found for', filePath, 'in', entryPoints);
36
+ formatted = join('No results found for', filePath, 'in the following entry points list:\n' + entryPoints.join('\n'));
37
37
  return formatted;
38
38
  }
39
39
  if (compactSummary) {
@@ -11,6 +11,13 @@ const resolvePathsToRoot = (node, all = false, resolvedPaths = [[]]) => {
11
11
  ...resolvedPath
12
12
  ]);
13
13
  if (node.parents.length === 0) {
14
+ /*
15
+ * If there is only one path, and has length of 1, it's file self reference
16
+ * It's invalid result, so we return empty paths in that case
17
+ */
18
+ if (newPaths.length === 1 && newPaths[0].length === 1) {
19
+ return [];
20
+ }
14
21
  return newPaths;
15
22
  }
16
23
  if (all) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rev-dep",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Dependency debugging tool for JavaScript and TypeScript projects",
5
5
  "main": "dist/module.js",
6
6
  "bin": "bin.js",