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:
Diffstat (limited to 'node_modules/@npmcli/arborist/lib/calc-dep-flags.js')
-rw-r--r--node_modules/@npmcli/arborist/lib/calc-dep-flags.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/node_modules/@npmcli/arborist/lib/calc-dep-flags.js b/node_modules/@npmcli/arborist/lib/calc-dep-flags.js
index 3d612607a..73f1e60d7 100644
--- a/node_modules/@npmcli/arborist/lib/calc-dep-flags.js
+++ b/node_modules/@npmcli/arborist/lib/calc-dep-flags.js
@@ -1,10 +1,12 @@
const { depth } = require('treeverse')
-const calcDepFlags = tree => {
- tree.dev = false
- tree.optional = false
- tree.devOptional = false
- tree.peer = false
+const calcDepFlags = (tree, resetRoot = true) => {
+ if (resetRoot) {
+ tree.dev = false
+ tree.optional = false
+ tree.devOptional = false
+ tree.peer = false
+ }
const ret = depth({
tree,
visit: node => calcDepFlagsStep(node),