lint

f27b3361e5dab7fc8f8d706ac603bad09309051f

BPplays <andymalbp@gmail.com>

2 files changed, +7 -7Showing whitespace changes
server.js+4 -4
@@ -289,11 +289,11 @@ if (dnsPreferIPv6) {
289const ipOptions = [true, 'auto', false];289const ipOptions = [true, 'auto', false];
290290
291if (!ipOptions.includes(enableIPv6)) {291if (!ipOptions.includes(enableIPv6)) {
292 console.warn(color.red('`protocol: ipv6` option invalid'), "\n use:", ipOptions, "\n setting to: auto");292 console.warn(color.red('`protocol: ipv6` option invalid'), '\n use:', ipOptions, '\n setting to: auto');
293 enableIPv6 = 'auto';293 enableIPv6 = 'auto';
294}294}
295if (!ipOptions.includes(enableIPv4)) {295if (!ipOptions.includes(enableIPv4)) {
296 console.warn(color.red('`protocol: ipv4` option invalid'), "\n use:", ipOptions, "\n setting to: auto");296 console.warn(color.red('`protocol: ipv4` option invalid'), '\n use:', ipOptions, '\n setting to: auto');
297 enableIPv4 = 'auto';297 enableIPv4 = 'auto';
298}298}
299299
@@ -887,7 +887,7 @@ function createHttpsServer(url, ipVersion) {
887 server.on('error', reject);887 server.on('error', reject);
888 server.on('listening', resolve);888 server.on('listening', resolve);
889889
890 let host = url.hostname890 let host = url.hostname;
891 if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname);891 if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname);
892 server.listen({892 server.listen({
893 host: host,893 host: host,
@@ -910,7 +910,7 @@ function createHttpServer(url, ipVersion) {
910 server.on('error', reject);910 server.on('error', reject);
911 server.on('listening', resolve);911 server.on('listening', resolve);
912912
913 let host = url.hostname913 let host = url.hostname;
914 if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname);914 if (ipVersion === 6) host = urlHostnameToIPv6(url.hostname);
915 server.listen({915 server.listen({
916 host: host,916 host: host,
src/util.js+3 -3
@@ -693,13 +693,13 @@ export function isValidUrl(url) {
693}693}
694694
695export function urlHostnameToIPv6(hostname) {695export function urlHostnameToIPv6(hostname) {
696 if (hostname.startsWith("[")) {696 if (hostname.startsWith('[')) {
697 hostname = hostname.slice(1);697 hostname = hostname.slice(1);
698 }698 }
699 if (hostname.endsWith("]")) {699 if (hostname.endsWith(']')) {
700 hostname = hostname.slice(0, -1);700 hostname = hostname.slice(0, -1);
701 }701 }
702 return hostname702 return hostname;
703}703}
704704
705export function stringToBool(str) {705export function stringToBool(str) {