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
path: root/lib
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@github.com>2022-03-02 20:51:41 +0300
committerGitHub <noreply@github.com>2022-03-02 20:51:41 +0300
commita0900bdf1ab7a68988984735f1f3885d02ffb67f (patch)
treeab3a5f190d67d83d109abd4fb2412fdb486359ec /lib
parent45fc297f12e63c026715945a186ba0ec4efbdedb (diff)
fix(ls): respect `--include-workspace-root` (#4481)
Diffstat (limited to 'lib')
-rw-r--r--lib/commands/ls.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/commands/ls.js b/lib/commands/ls.js
index 8c338c064..e56c90dae 100644
--- a/lib/commands/ls.js
+++ b/lib/commands/ls.js
@@ -95,10 +95,15 @@ class LS extends ArboristWorkspaceCmd {
return true
}
+ if (this.npm.flatOptions.includeWorkspaceRoot
+ && !edge.to.isWorkspace) {
+ return true
+ }
+
if (edge.from.isProjectRoot) {
- return edge.to &&
- edge.to.isWorkspace &&
- wsNodes.includes(edge.to.target)
+ return (edge.to
+ && edge.to.isWorkspace
+ && wsNodes.includes(edge.to.target))
}
return true