Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ls.js
diff options
context:
space:
mode:
authorRuy Adorno <ruyadorno@hotmail.com>2020-07-23 18:31:10 +0300
committerisaacs <i@izs.me>2020-07-23 19:57:11 +0300
commit79fd6e0b437effea471e1c98b3b4524ccdd6b866 (patch)
treeae9477cdf285400a611dc56b8c16774b359d77cc /lib/ls.js
parent1f82ba9e4aae988bb342bfaf8ba99d80c40ea430 (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/ls.js')
-rw-r--r--lib/ls.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/ls.js b/lib/ls.js
index d8f0554ad..2c6171b3c 100644
--- a/lib/ls.js
+++ b/lib/ls.js
@@ -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
}