|
|
@ -10,6 +10,10 @@ const util = require("../Util"); |
|
|
|
* @returns {Promise<Boolean>} Returns a boolean. |
|
|
|
*/ |
|
|
|
module.exports.port = async function (port, protocol) { |
|
|
|
util.checkNodeVersion(); |
|
|
|
util.checkPlatform(); |
|
|
|
await util.checkPlatformExact(); |
|
|
|
|
|
|
|
try { |
|
|
|
if (!port) throw new Error("Missing port input."); |
|
|
|
if (typeof port !== "number") throw new Error("The port must be type of number."); |
|
|
@ -51,6 +55,10 @@ module.exports.port = async function (port, protocol) { |
|
|
|
* @returns {Promise<Boolean>} Returns a boolean. |
|
|
|
*/ |
|
|
|
module.exports.address = async function (address, port, protocol) { |
|
|
|
util.checkNodeVersion(); |
|
|
|
util.checkPlatform(); |
|
|
|
await util.checkPlatformExact(); |
|
|
|
|
|
|
|
try { |
|
|
|
// address validation
|
|
|
|
if (!address) throw new Error("Missing address input."); |
|
|
|