mirror of
https://github.com/actions/setup-node.git
synced 2025-06-29 06:03:50 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
13
node_modules/semver-compare/index.js
generated
vendored
Normal file
13
node_modules/semver-compare/index.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
module.exports = function cmp (a, b) {
|
||||
var pa = a.split('.');
|
||||
var pb = b.split('.');
|
||||
for (var i = 0; i < 3; i++) {
|
||||
var na = Number(pa[i]);
|
||||
var nb = Number(pb[i]);
|
||||
if (na > nb) return 1;
|
||||
if (nb > na) return -1;
|
||||
if (!isNaN(na) && isNaN(nb)) return 1;
|
||||
if (isNaN(na) && !isNaN(nb)) return -1;
|
||||
}
|
||||
return 0;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue