Skip to content

Commit

Permalink
fix: Revert wrong compatibility specifier logic (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov authored Jan 26, 2023
1 parent e6178b8 commit 2d10b9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions lib/specifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ function pick(versions, specifier, options) {
}

function satisfies(version, specifier, options = {}) {
if (specifier.startsWith("~=")) {
if (Operator.eq(version, specifier.replace(/^~=\s*/, ""))) {
return true;
}
}

const filtered = pick([version], specifier, options);

return filtered.length === 1;
Expand Down
2 changes: 1 addition & 1 deletion test/specifier.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ describe("satisfies(version, specifier)", () => {
["3.10", "==3.10.*"],
["3.10.0", "==3.10.*"],
["0.1.dev123+deadbeef", "==0.1.dev123+deadbeef"],
["0.1.dev123+deadbeef", "~=0.1.dev123+deadbeef"],

// Test some normalization rules
["2.0.5", ">2.0dev"],
Expand Down Expand Up @@ -417,6 +416,7 @@ describe("satisfies(version, specifier)", () => {
["2.0", "~=1.0"],
["1.1.0", "~=1.0.0"],
["1.1.post1", "~=1.0.0"],
["0.1.dev123+deadbeef", "~=0.1.dev123+deadbeef"],

// Test that epochs are handled sanely
["1.0", "~=2!1.0"],
Expand Down

0 comments on commit 2d10b9e

Please sign in to comment.