(
{ name, type, bundled, from, spec, rawSpec, overridden },
depth, chalk, seen = new Set()
)
| 76 | } |
| 77 | |
| 78 | const explainEdge = ( |
| 79 | { name, type, bundled, from, spec, rawSpec, overridden }, |
| 80 | depth, chalk, seen = new Set() |
| 81 | ) => { |
| 82 | let dep = type === 'workspace' |
| 83 | ? chalk.bold(relative(from.location, spec.slice('file:'.length))) |
| 84 | : `${name}@"${spec}"` |
| 85 | if (overridden) { |
| 86 | dep = `${colorType('overridden', chalk)} ${dep} (was "${rawSpec}")` |
| 87 | } |
| 88 | |
| 89 | const fromMsg = ` from ${explainFrom(from, depth, chalk, seen)}` |
| 90 | |
| 91 | return (type === 'prod' ? '' : `${colorType(type, chalk)} `) + |
| 92 | (bundled ? `${colorType('bundled', chalk)} ` : '') + |
| 93 | `${dep}${fromMsg}` |
| 94 | } |
| 95 | |
| 96 | const explainFrom = (from, depth, chalk, seen) => { |
| 97 | if (!from.name && !from.version) { |
no test coverage detected