Skip to content

Commit

Permalink
fix(inspector): fix file tree flat algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 28, 2023
1 parent aef16f5 commit 9fbb3c0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/inspector/client/composables/fetch.ts
Expand Up @@ -109,13 +109,14 @@ function toTree(modules: ModuleDest[], name: string) {
const children = Object.values(node.children)
if (children.length === 1 && !node.items.length) {
const child = children[0]
if (child) {
node.name = node.name ? `${node.name}/${child.name}` : child.name
node.items = child.items
node.children = child.children
}
node.name = node.name ? `${node.name}/${child.name}` : child.name
node.items = child.items
node.children = child.children
flat(node)
}
else {
children.forEach(flat)
}
children.forEach(flat)
}

Object.values(node.children).forEach(flat)
Expand Down

0 comments on commit 9fbb3c0

Please sign in to comment.