Skip to content

Commit

Permalink
chore: better tree debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 5, 2023
1 parent 9ea2cb6 commit 348e95c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/utils.ts
Expand Up @@ -30,13 +30,15 @@ function printTree(
const hasNext = index++ < total - 1
const { children } = child

treeStr += `${`${parentPre}${hasNext ? '├' : '└'}─ `}${child}\n`
treeStr += `${`${parentPre}${hasNext ? '├' : '└'}${
'─' + (children.size > 0 ? '┬' : '')
} `}${child}\n`

if (children) {
treeStr += printTree(
children,
level + 1,
`${parentPre}${hasNext ? '│' : ' '} `
`${parentPre}${hasNext ? '│' : ' '} `
)
}
}
Expand Down

0 comments on commit 348e95c

Please sign in to comment.