| 508 | const sortAlphabetically = ({ pkgid: a }, { pkgid: b }) => localeCompare(a, b) |
| 509 | |
| 510 | const humanOutput = ({ chalk, result, seenItems, unicode }) => { |
| 511 | // 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) |
| 512 | // here is where we put items in their expected place for archy output |
| 513 | for (const item of seenItems) { |
| 514 | if (item[_include] && item[_parent]) { |
| 515 | item[_parent].nodes.push(item) |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | if (!result.nodes.length) { |
| 520 | result.nodes = ['(empty)'] |
| 521 | } |
| 522 | |
| 523 | const archyOutput = archy(result, '', { unicode }) |
| 524 | return chalk.reset(archyOutput) |
| 525 | } |
| 526 | |
| 527 | const jsonOutput = ({ path, problems, result, rootError, seenItems }) => { |
| 528 | if (problems.size) { |