Skip to content

Commit

Permalink
feat: remove repeated child on dependency tree view
Browse files Browse the repository at this point in the history
  • Loading branch information
sz-p committed Jul 1, 2024
1 parent 44ad698 commit 9956951
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/dependency-tree/src/core/dependencyTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,18 @@ export class DependencyTree {
);
continue;
}
const children = parser(
let children = parser(
dependencyNode,
absolutePath,
codeString,
this.options,
this.parseRule,
this.parsers
);
// remove repeated child
if (children.length >= 2) {
children = Array.from(new Set(children));
}
// if not set dependencyNode in dependencyHash before
// will not found analyzed node
this.dependencyHash[absolutePath] = dependencyNode;
Expand Down

0 comments on commit 9956951

Please sign in to comment.