diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-07-23 18:31:10 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-07-23 19:57:11 +0300 |
commit | 79fd6e0b437effea471e1c98b3b4524ccdd6b866 (patch) | |
tree | ae9477cdf285400a611dc56b8c16774b359d77cc /lib | |
parent | 1f82ba9e4aae988bb342bfaf8ba99d80c40ea430 (diff) |
fix: more dedupe edge cases
PR-URL: https://github.com/npm/cli/pull/1545
Credit: @ruyadorno
Close: #1545
Reviewed-by: @isaacs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ls.js | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -115,27 +115,27 @@ const getHumanOutputItem = (node, { args, color, global, long }) => { const missingColor = isOptional(node) ? chalk.yellow.bgBlack : chalk.red.bgBlack - const missingMsg = `UNMET ${isOptional(node) ? 'OPTIONAL ' : ''}DEPENDENCY ` + const missingMsg = `UNMET ${isOptional(node) ? 'OPTIONAL ' : ''}DEPENDENCY` const label = ( node[_missing] - ? (color ? missingColor(missingMsg) : missingMsg) + ? (color ? missingColor(missingMsg) : missingMsg) + ' ' : '' ) + `${highlightDepName ? chalk.yellow.bgBlack(printable) : printable}` + ( node[_dedupe] - ? (color ? chalk.gray(' deduped') : ' deduped') + ? ' ' + (color ? chalk.gray('deduped') : 'deduped') : '' ) + ( node[_invalid] - ? (color ? chalk.red.bgBlack(' invalid') : ' invalid') + ? ' ' + (color ? chalk.red.bgBlack('invalid') : 'invalid') : '' ) + ( isExtraneous(node, { global }) - ? (color ? chalk.green.bgBlack(' extraneous') : ' extraneous') + ? ' ' + (color ? chalk.green.bgBlack('extraneous') : 'extraneous') : '' ) + (isGitNode(node) ? ` (${node.resolved})` : '') + @@ -263,6 +263,9 @@ const augmentNodesWithMetadata = ({ pkgid: node.pkgid, package: node.package, path: node.path, + isLink: node.isLink, + realpath: node.realpath, + [_invalid]: node[_invalid], [_missing]: node[_missing], [_dedupe]: true } |