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

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js')
-rw-r--r--deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
index ebbe004de72..83cb1f66f3a 100644
--- a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
+++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js
@@ -255,9 +255,11 @@ class Shrinkwrap {
if (val)
meta[key.replace(/^_/, '')] = val
})
- // we only include name if different from the node path name
+ // we only include name if different from the node path name, and for the
+ // root to help prevent churn based on the name of the directory the
+ // project is in
const pname = node.packageName
- if (pname && pname !== node.name)
+ if (pname && (node === node.root || pname !== node.name))
meta.name = pname
if (node.isTop && node.package.devDependencies)