Browse Source

added check appropriate port function

develop
ray-1337 3 years ago
parent
commit
79f51e867a
  1. 13
      src/Util.js

13
src/Util.js

@ -75,6 +75,19 @@ module.exports.checkPlatformExact = function () {
return true; return true;
}; };
module.exports.checkAppropriatePort = function(port) {
if (typeof port !== "number") {
throw new Error("The port must be type of number.");
};
let portLimit = Math.round(2 ** 16 - 1);
if (port <= 0 || port > portLimit) {
throw new Error("Exceeded port limit.");
};
return true;
};
// soon to be continued // soon to be continued
// module.exports.checkPlatformVersion = function () { // module.exports.checkPlatformVersion = function () {
// let distroInfo = this.getDistroInfo(); // let distroInfo = this.getDistroInfo();

Loading…
Cancel
Save