Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
correct range lower bound
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 7, 2015
1 parent 559f425 commit cfead5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions npm.js
Expand Up @@ -804,11 +804,11 @@ function parseDependencies(dependencies, ui) {
// if upper bound is exact minor
else if (upperSemver[3] == 0 && !upperSemver[4]) {
// if lower bound is minor below, we are fuzzy compatible
if (lowerSemver[2] = upperSemver[2] - 1)
if (lowerSemver[2] == upperSemver[2] - 1)
version = '~' + getVersion(lowerSemver);
// otherwise we are fuzzy compatible with previous
else
version = '~' + upperSemver[1] + '.' + (upperSemver[2] - 1);
version = '~' + upperSemver[1] + '.' + (upperSemver[2] - 1) + '.0';
}
// if upper bound is exact version -> use exact
else
Expand Down
2 changes: 2 additions & 0 deletions test/unit.js
Expand Up @@ -31,4 +31,6 @@ testDependency('@scoped/react', '0.12.x', '@scoped/react', '@scoped/react@~0.12.
testDependency('@scoped/react', '0.x', '@scoped/react', '@scoped/react@0');
testDependency('@scoped/react', '>=0.12.0', '@scoped/react', '@scoped/react@*');

testDependency('get-size', '>=1.1.4 <1.3', 'get-size', 'get-size@~1.2.0');

console.log('Unit tests passed');

0 comments on commit cfead5a

Please sign in to comment.