Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
intersection: use semver.version, not semver.raw
  • Loading branch information
isaacs committed Jul 24, 2017
1 parent 4bacbfa commit 6cb2bcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion semver.js
Expand Up @@ -725,7 +725,7 @@ Comparator.prototype.intersects = function(comp, loose) {
var sameDirectionDecreasing =
(this.operator === '<=' || this.operator === '<') &&
(comp.operator === '<=' || comp.operator === '<');
var sameSemVer = this.semver.raw === comp.semver.raw;
var sameSemVer = this.semver.version === comp.semver.version;
var differentDirectionsInclusive =
(this.operator === '>=' || this.operator === '<=') &&
(comp.operator === '>=' || comp.operator === '<=');
Expand Down
2 changes: 2 additions & 0 deletions test/index.js
Expand Up @@ -733,8 +733,10 @@ test('\nintersect comparators', function(t) {
['<1.2.0', '<=1.3.0', true],
// Different directions, same semver and inclusive operator
['>=1.3.0', '<=1.3.0', true],
['>=v1.3.0', '<=1.3.0', true],
['>=1.3.0', '>=1.3.0', true],
['<=1.3.0', '<=1.3.0', true],
['<=1.3.0', '<=v1.3.0', true],
['>1.3.0', '<=1.3.0', false],
['>=1.3.0', '<1.3.0', false],
// Opposite matching directions
Expand Down

0 comments on commit 6cb2bcb

Please sign in to comment.