diff --git a/semver.js b/semver.js index 1c3c4f96..1adc1e4a 100644 --- a/semver.js +++ b/semver.js @@ -934,13 +934,19 @@ Range.prototype.intersects = function (range, options) { } return this.set.some(function (thisComparators) { - return range.set.some(function (rangeComparators) { - return isSatisfiable(thisComparators, options) && thisComparators.every(function (thisComparator) { - return isSatisfiable(rangeComparators, options) && 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) + }) + }) + ) }) - }) + ) }) }