Skip to content
This repository has been archived by the owner on Jun 8, 2018. It is now read-only.

getChain bug #5

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 27 additions & 16 deletions lib/dep-graph.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/dep-graph.coffee
Expand Up @@ -27,8 +27,7 @@ class DepGraph
visit = (node) =>
return if visited[node] or node is id
visited[node] = true
for parent in @parentsOf(node)
visit parent
visit parent for parent in @parentsOf(node) when parent in deps
chain.unshift node

for leafNode in _.intersection(deps, @leafNodes()).reverse()
Expand Down Expand Up @@ -57,4 +56,4 @@ class DepGraph
if module?.exports?
module.exports = DepGraph
else
@DepGraph = DepGraph
@DepGraph = DepGraph