more jsdoc stuff

aa10dd98c9e2fc8f605962dab3280de1654e2c89

BPplays <andymalbp@gmail.com>

1 files changed, +16 -7Ignore whitespace
server.js+16 -7
@@ -998,7 +998,13 @@ async function startHTTPorHTTPS(useIPv6, useIPv4) {
998998async function startServer() {
999999 let useIPv6 = (enableIPv6 === true);
10001000 let useIPv4 = (enableIPv4 === true);
1001- let hasIPv6, hasIPv4, hasIPv6Local, hasIPv4Local, hasIPv6Any, hasIPv4Any;
1001+
1002+ let /** @type {boolean} */ hasIPv6,
1003+ /** @type {boolean} */ hasIPv4,
1004+ /** @type {boolean} */ hasIPv6Local,
1005+ /** @type {boolean} */ hasIPv4Local,
1006+ /** @type {boolean} */ hasIPv6Any,
1007+ /** @type {boolean} */ hasIPv4Any;
10021008
10031009
10041010 if (enableIPv6 === 'auto' || enableIPv4 === 'auto') {
@@ -1028,18 +1034,21 @@ async function startServer() {
10281034 console.log('IPv4 support detected (but disabled)');
10291035 }
10301036 }
1037+
1038+
1039+ if (enableIPv6 === 'auto' && enableIPv4 === 'auto') {
1040+ if (!hasIPv6 && !hasIPv4) {
1041+ console.error('Both IPv6 and IPv4 are not detected');
1042+ process.exit(1);
1043+ }
1044+ }
1045+
10311046 } else {
10321047 console.log('Neither protocol: ipv6, nor ipv4 are set to auto, skipping detection');
10331048 }
10341049
10351050
10361051
1037- if (enableIPv6 === 'auto' && enableIPv4 === 'auto') {
1038- if (!hasIPv6 && !hasIPv4) {
1039- console.error('Both IPv6 and IPv4 are not detected');
1040- process.exit(1);
1041- }
1042- }
10431052
10441053 if (!useIPv6 && !useIPv4) {
10451054 console.error('Both IPv6 and IPv4 are disabled,\nP.S. you should never see this error, at least at one point it was checked for before this, with the rest of the config options');