Comparing version 5.7.0 to 6.0.0
# changes log | ||
## 6.0 | ||
* Fix `intersects` logic. | ||
This is technically a bug fix, but since it is also a change to behavior | ||
that may require users updating their code, it is marked as a major | ||
version increment. | ||
## 5.7 | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "semver", | ||
"version": "5.7.0", | ||
"version": "6.0.0", | ||
"description": "The semantic version parser used by npm.", | ||
@@ -5,0 +5,0 @@ "main": "semver.js", |
@@ -937,12 +937,36 @@ exports = module.exports = SemVer | ||
return this.set.some(function (thisComparators) { | ||
return thisComparators.every(function (thisComparator) { | ||
return range.set.some(function (rangeComparators) { | ||
return rangeComparators.every(function (rangeComparator) { | ||
return thisComparator.intersects(rangeComparator, options) | ||
}) | ||
return ( | ||
isSatisfiable(thisComparators, options) && | ||
range.set.some(function (rangeComparators) { | ||
return ( | ||
isSatisfiable(rangeComparators, options) && | ||
thisComparators.every(function (thisComparator) { | ||
return rangeComparators.every(function (rangeComparator) { | ||
return thisComparator.intersects(rangeComparator, options) | ||
}) | ||
}) | ||
) | ||
}) | ||
}) | ||
) | ||
}) | ||
} | ||
// take a set of comparators and determine whether there | ||
// exists a version which can satisfy it | ||
function isSatisfiable (comparators, options) { | ||
var result = true | ||
var remainingComparators = comparators.slice() | ||
var testComparator = remainingComparators.pop() | ||
while (result && remainingComparators.length) { | ||
result = remainingComparators.every(function (otherComparator) { | ||
return testComparator.intersects(otherComparator, options) | ||
}) | ||
testComparator = remainingComparators.pop() | ||
} | ||
return result | ||
} | ||
// Mostly just for testing and legacy API reasons | ||
@@ -949,0 +973,0 @@ exports.toComparators = toComparators |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
62471
1290
0