nightTab/js/version.js

39 lines
715 B
JavaScript
Raw Normal View History

2018-12-27 18:41:40 +00:00
var version = (function() {
// version is normally bumped when the state needs changing or any new functionality is added
var current = "2.20.0";
var compare = function(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;
};
2018-12-27 18:41:40 +00:00
var get = function() {
return current;
2018-12-27 18:41:40 +00:00
};
// exposed methods
return {
get: get,
compare: compare
2018-12-27 18:41:40 +00:00
};
})();