Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2022-04-14 01:03:37 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-04-20 02:22:20 +0300
commit3d964940f410052918e37a9b05818fe9dc4cd86a (patch)
tree6d9266b9db42d21c4e8e6bf89475f0aef4acacee /workspaces/arborist/lib
parent4ca858c4e210781f369c4403e711dbbbbe5aaca6 (diff)
fix(arborist): when replacing a Link with a Node, make sure to remove the Link target from the root
Diffstat (limited to 'workspaces/arborist/lib')
-rw-r--r--workspaces/arborist/lib/node.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/workspaces/arborist/lib/node.js b/workspaces/arborist/lib/node.js
index c79bc0bd3..abd54ffe9 100644
--- a/workspaces/arborist/lib/node.js
+++ b/workspaces/arborist/lib/node.js
@@ -1149,6 +1149,9 @@ class Node {
for (const kid of node.children.values()) {
kid.parent = this
}
+ if (node.isLink && node.target) {
+ node.target.root = null
+ }
}
if (!node.isRoot) {