mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-12 18:49:41 -04:00
fix(dependencies-hierarchy): fix resultHeight calculation
This previously double incremented `resultHeight`. When writing this, I was thinking the child node's height was 1 more than the call for its dependencies. The parent node (the result) would then be more more than that. However, `resultHeight`'s definition is based the longest edge in the dependencies array returned, which doesn't include the parent node. The additional `+ 1` to account for the parent node should never have been added.
This commit is contained in:
committed by
Zoltan Kochan
parent
35fea5ea74
commit
09065b8a78
@@ -119,7 +119,7 @@ function getTreeHelper (
|
||||
const children = getChildrenTree(keypath.concat([relativeId]), relativeId)
|
||||
dependencies = children.dependencies
|
||||
const heightOfCurrentDepNode = children.height == null ? 0 : children.height + 1
|
||||
resultHeight = Math.max(resultHeight ?? 0, heightOfCurrentDepNode + 1)
|
||||
resultHeight = Math.max(resultHeight ?? 0, heightOfCurrentDepNode)
|
||||
resultIsPartiallyVisited = resultIsPartiallyVisited || children.isPartiallyVisited
|
||||
|
||||
if (children.circular) {
|
||||
|
||||
Reference in New Issue
Block a user