Skip to content

Commit

Permalink
fix: check cycle when graphl is all globals
Browse files Browse the repository at this point in the history
  • Loading branch information
benawad committed Apr 25, 2020
1 parent 17c1e85 commit 7880933
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index/generateTrees/toFractalTree.ts
Expand Up @@ -73,7 +73,9 @@ export function toFractalTree(graph: Graph, entryPoints: string[]) {
const newDestination = path.join(folderPath, directoryName);

for (const importFilePath of imports) {
if (importFilePath in tree) {
// if importFilePath includes .. then it's a global
// we don't store globals in tree, so check if cycle
if (importFilePath in tree || importFilePath.includes("..")) {
const cycle = hasCycle(importFilePath, graph, new Set());

if (cycle) {
Expand Down

0 comments on commit 7880933

Please sign in to comment.