Skip to content

Commit

Permalink
Fix dedupe logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AlonNavon committed Nov 4, 2024
1 parent 35e5790 commit 35ce2f7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions workspaces/arborist/lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,13 @@ class Node {
return false
}

// if we prefer dedupe, or if the version is greater/equal, take the other
if (preferDedupe || semver.gte(other.version, this.version)) {
// if we prefer dedupe, or if the version is equal, take the other
if (preferDedupe || semver.eq(other.version, this.version)) {
return true
}

// if our current version isn't the result of an override, then prefer to take the greater version
if (!this.overridden && semver.gt(other.version, this.version)) {
return true
}

Expand Down

0 comments on commit 35ce2f7

Please sign in to comment.