which-electron/src/version.js

19 lines
463 B
JavaScript
Raw Permalink Normal View History

2021-11-24 09:35:35 +00:00
const semver = require("semver");
const VERSIONS = require("./versions");
module.exports = {
2021-11-24 09:35:35 +00:00
asText: function (listOfVersions) {
sorted = listOfVersions.sort(semver.compare);
return `${sorted[0]}-${sorted[sorted.length - 1]}`;
},
2021-11-24 09:35:35 +00:00
max: function (listOfVersions) {
sorted = listOfVersions.sort(semver.compare);
return sorted[sorted.length - 1];
},
2021-11-24 09:35:35 +00:00
isSupported: function (v) {
return VERSIONS["supported"].indexOf(v) !== -1;
},
};