@@ -131,12 +131,12 @@ class LS extends ArboristWorkspaceCmd {
131
131
const target = ( node . target ) ?. edgesOut
132
132
133
133
const shouldSkipChildren =
134
- ( currentDepth > depthToPrint ) ||
135
- ( ! nodeResult && ! node . isRoot ) || nodeResult ?. isCircular
134
+ ( currentDepth > depthToPrint )
135
+ || nodeResult ?. isCircular
136
136
137
- return ( shouldSkipChildren )
137
+ return ( shouldSkipChildren || ! target )
138
138
? [ ]
139
- : [ ...( target ? .values ( ) || [ ] ) ]
139
+ : [ ...target . values ( ) ]
140
140
. filter ( filterBySelectedWorkspaces )
141
141
. filter ( currentDepth === 0 ? filterByEdgesTypes ( {
142
142
link,
@@ -170,9 +170,7 @@ class LS extends ArboristWorkspaceCmd {
170
170
}
171
171
}
172
172
173
- if ( item ) {
174
- item . traversePath = ( node [ _parent ] ?. traversePath || [ ] ) . concat ( [ node . realpath + '-' + node . pkgid ] )
175
- }
173
+ item . traversePath = ( node [ _parent ] ?. traversePath || [ ] ) . concat ( [ node . realpath + '-' + node . pkgid ] )
176
174
177
175
if ( node [ _parent ] ?. traversePath ?. includes ( node . realpath + '-' + node . pkgid ) ) {
178
176
item . isCircular = true
@@ -429,7 +427,7 @@ const filterByEdgesTypes = ({ link, omit }) => (edge) => {
429
427
const appendExtraneousChildren = ( { node, seenPaths } ) =>
430
428
// extraneous children are not represented
431
429
// in edges out, so here we add them to the list:
432
- [ ...( ( node ? .children ) ? .values ( ) || [ ] ) ]
430
+ [ ...node . children . values ( ) ]
433
431
. filter ( i => ! seenPaths . has ( i . path ) && i . extraneous )
434
432
435
433
const mapEdgesToNodes = ( { seenPaths } ) => ( edge ) => {
0 commit comments