diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2020-09-25 06:12:06 +0300 |
---|---|---|
committer | nlf <quitlahok@gmail.com> | 2020-09-29 21:43:49 +0300 |
commit | 2715220c9b5d3f325e65e95bae2b5af8a485a579 (patch) | |
tree | 33fef85be06f6def8d8d5abaa2707538d8d6e3b0 /lib/utils | |
parent | 90550b2e023e7638134e91c80ed96828afb41539 (diff) |
fix: added count on reify-output
The added count on lib/utils/reify-output.js only looks up resulting
keys from arb.diff and does not take into account the fact that some of
these pkgs signaled as diff=ADD might in fact not have been installed,
most common scenario are optional deps that could have failed their
install in a given system or opt-out from configs.
This fixes the counting number by looking up at arb.inventory and
confirming it has the node that has been marked as added on diff result.
Fix: #1813
PR-URL: https://github.com/npm/cli/pull/1858
Credit: @ruyadorno
Close: #1858
Reviewed-by: @nlf
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/reify-output.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/reify-output.js b/lib/utils/reify-output.js index e32cfb582..09b31fa94 100644 --- a/lib/utils/reify-output.js +++ b/lib/utils/reify-output.js @@ -43,7 +43,7 @@ const reifyOutput = arb => { summary.removed++ break case 'ADD': - summary.added++ + actualTree.inventory.has(d.ideal) && summary.added++ break case 'CHANGE': summary.changed++ |