| 524 | const sortAlphabetically = ({ pkgid: a }, { pkgid: b }) => localeCompare(a, b) |
| 525 | |
| 526 | const humanOutput = ({ chalk, result, seenItems, unicode }) => { |
| 527 | // we need to traverse the entire tree in order to determine which items should be included (since a nested transitive included dep will make it so that all its ancestors should be displayed) |
| 528 | // here is where we put items in their expected place for archy output |
| 529 | for (const item of seenItems) { |
| 530 | if (item[_include] && item[_parent]) { |
| 531 | item[_parent].nodes.push(item) |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | if (!result.nodes.length) { |
| 536 | result.nodes = ['(empty)'] |
| 537 | } |
| 538 | |
| 539 | const archyOutput = archy(result, '', { unicode }) |
| 540 | return chalk.reset(archyOutput) |
| 541 | } |
| 542 | |
| 543 | const jsonOutput = ({ path, problems, result, rootError, seenItems }) => { |
| 544 | if (problems.size) { |