diff options
author | Nathan Fritz <fritzy@github.com> | 2022-03-02 20:51:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-02 20:51:41 +0300 |
commit | a0900bdf1ab7a68988984735f1f3885d02ffb67f (patch) | |
tree | ab3a5f190d67d83d109abd4fb2412fdb486359ec /lib | |
parent | 45fc297f12e63c026715945a186ba0ec4efbdedb (diff) |
fix(ls): respect `--include-workspace-root` (#4481)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/commands/ls.js | 11 |
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 |