Fix misc problems detected by ESLint

Reformat and clean up issues detected by ESLint.
This commit is contained in:
Hornwitser committed 2020-06-17 20:59:37 +02:00
1 parent 8cb21c5fa8
commit e9f5cae4f0
34 files changed
+132 -189

No files matched your search

+7 -9
View File
@@ -167,9 +167,9 @@ function randomDynamicPort() {
async function generatePassword(length) {
function validChar(byte) {
const ranges = ["az", "AZ", "09"];
return ranges.some(range =>
return ranges.some(range => (
range.codePointAt(0) <= byte && byte <= range.codePointAt(1)
);
));
}
let randomBytesAsync = util.promisify(crypto.randomBytes);
@@ -559,9 +559,9 @@ class FactorioServer extends events.EventEmitter {
let channel = line
.slice(6, channelEnd)
.toString("utf-8")
.replace(/\\x([0-9a-f]{2})/g, (match, p1) =>
.replace(/\\x([0-9a-f]{2})/g, (match, p1) => (
String.fromCharCode(parseInt(p1, 16))
)
))
;
let type = line.slice(channelEnd + 1, channelEnd + 2).toString("utf-8");
@@ -619,10 +619,8 @@ class FactorioServer extends events.EventEmitter {
if (!expected.includes(output[name])) {
continue heuristicLoop;
}
} else {
if (expected !== output[name]) {
continue heuristicLoop;
}
} else if (expected !== output[name]) {
continue heuristicLoop;
}
}
@@ -651,7 +649,7 @@ class FactorioServer extends events.EventEmitter {
};
this._rconClient = new rconClient.Rcon(config);
this._rconClient.on("error", err => { /* Ignore */ });
this._rconClient.on("error", () => { /* Ignore */ });
this._rconClient.on("authenticated", () => { this._rconReady = true; this.emit("rcon-ready"); });
this._rconClient.on("end", () => {
this._rconClient = null;