Fix missing semicolons

Ensure all statements end with a semicolon.
This commit is contained in:
Hornwitser committed 2020-06-17 20:53:18 +02:00
1 parent 34aaeee354
commit 29f066a191
56 files changed
+242 -242

No files matched your search

+13 -13
View File
@@ -140,7 +140,7 @@ function randomDynamicPort() {
const start = 49152;
const end = 65535 + 1;
return Math.floor(Math.random() * (end - start) + start)
return Math.floor(Math.random() * (end - start) + start);
}
/**
@@ -206,7 +206,7 @@ class LineSplitter {
*/
constructor(callback) {
this._callback = callback;
this._partial = null
this._partial = null;
}
/**
@@ -278,12 +278,12 @@ function parseOutput(line, source) {
let output = {
source,
received: Date.now(),
}
};
// There are three broad categories of output from Factorio, the first kind
// starts with the seconds since the server started and has a format of
// " 0.704 message"
const secRegex = /^ {0,3}(\d+\.\d+) (.*)$/
const secRegex = /^ {0,3}(\d+\.\d+) (.*)$/;
let secMatch = secRegex.exec(line);
if (secMatch) {
output.format = "seconds";
@@ -293,7 +293,7 @@ function parseOutput(line, source) {
// A seconds output has two different kinds of formats: The first is a
// log level and source location and has a format of
// "Level File.cpp:123: message"
const secLogRegex = /^(\w+) (\w+\.cpp:\d+): (.*)$/
const secLogRegex = /^(\w+) (\w+\.cpp:\d+): (.*)$/;
let secLogMatch = secLogRegex.exec(secContent);
if (secLogMatch) {
output.type = "log";
@@ -310,7 +310,7 @@ function parseOutput(line, source) {
// The second category of output starts with a date stamp of the format
// "yyyy-mm-dd hh:mm:ss message"
} else {
const dateRegex = /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d) (.*)$/
const dateRegex = /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d) (.*)$/;
let dateMatch = dateRegex.exec(line);
if (dateMatch) {
output.format = "date";
@@ -319,7 +319,7 @@ function parseOutput(line, source) {
// A date output has two general formats. The first is an action
// followed by a message and has a format of "[ACTION] message"
const dateActionRegex = /^\[(\w+)\] (.*)$/
const dateActionRegex = /^\[(\w+)\] (.*)$/;
let dateActionMatch = dateActionRegex.exec(dateContent);
if (dateActionMatch) {
output.type = "action";
@@ -523,14 +523,14 @@ class FactorioServer extends events.EventEmitter {
this.on("_autosave", function(name) {
this.emit("autosave-start", name);
this._runningAutosave = name;
})
});
this.on("_saved", function() {
if (this._runningAutosave) {
this.emit("autosave-finished", this._runningAutosave);
this._runningAutosave = null;
}
})
});
}
_check(expectedStates) {
@@ -566,7 +566,7 @@ class FactorioServer extends events.EventEmitter {
// Prevent malicious names
if (/[\\/\0]/.test(fileName)) {
throw new Error(`Invalid IPC file name '${fileName}'`)
throw new Error(`Invalid IPC file name '${fileName}'`);
}
if (fileName.endsWith(".json")) {
@@ -575,7 +575,7 @@ class FactorioServer extends events.EventEmitter {
} else {
let format = fileName.slice(fileName.lastIndexOf(".") + 1);
throw new Error(`Unknown IPC file format '${format}'`)
throw new Error(`Unknown IPC file format '${format}'`);
}
} else {
@@ -703,7 +703,7 @@ class FactorioServer extends events.EventEmitter {
} else {
let msg;
if (code !== null) {
msg = `Factorio server unexpectedly shut down with code ${code}`
msg = `Factorio server unexpectedly shut down with code ${code}`;
} else {
msg = `Factorio server was unexpectedly shut by down by signal ${signal}`;
}
@@ -865,7 +865,7 @@ class FactorioServer extends events.EventEmitter {
* @returns {string} response from server.
*/
async sendRcon(message, expectEmpty) {
this._check(["running", "stopping"])
this._check(["running", "stopping"]);
if (!this._rconReady) {
await events.once(this, "rcon-ready");
}