Skip to content

Commit

Permalink
Merge pull request #493 from AikidoSec/fix-mysql2-hooks
Browse files Browse the repository at this point in the history
Fix mysql2 hooks
  • Loading branch information
hansott authored Jan 3, 2025
2 parents ef592e3 + 3e05fd1 commit d8c8ed1
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 146 deletions.
2 changes: 2 additions & 0 deletions library/helpers/satisfiesVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ t.test("it matches single range", async () => {
t.equal(satisfiesVersion("^1.0.0", "0.0.0"), false);
t.equal(satisfiesVersion("^1.0.0", "2.0.0"), false);
t.equal(satisfiesVersion("^2.0.0", "1.0.0"), false);
t.equal(satisfiesVersion("^1.2.1", "1.3.0"), true);
t.equal(satisfiesVersion("^1.2.1", "1.2.0"), false);
});

t.test("it matches multiple ranges", async () => {
Expand Down
14 changes: 12 additions & 2 deletions library/helpers/satisfiesVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,19 @@ export function satisfiesVersion(range: string, version: string) {
.split(".")
.map((p) => parseInt(p, 10));

if (major === rMajor && minor >= rMinor && patch >= rPatch) {
return true;
if (major !== rMajor) {
continue;
}

if (minor < rMinor) {
continue;
}

if (minor === rMinor && patch < rPatch) {
continue;
}

return true;
}

return false;
Expand Down
71 changes: 64 additions & 7 deletions library/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"mongodb-v5": "npm:mongodb@^5.0.0",
"mongodb-v6": "npm:mongodb@^6.0.0",
"mysql": "^2.18.1",
"mysql2": "^3.10.0",
"mysql2-v3.10": "npm:[email protected]",
"mysql2-v3.12": "npm:[email protected]",
"needle": "^3.3.1",
"node-fetch": "^2",
"percentile": "^1.6.0",
Expand Down
114 changes: 0 additions & 114 deletions library/sinks/MySQL2.test.ts

This file was deleted.

Loading

0 comments on commit d8c8ed1

Please sign in to comment.