mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +09:00
Use more consistent spacing in objects literals
This commit is contained in:
1 parent
29f066a191
commit
b254e4189d
17 files changed
+66
-66
No files matched your search
@@ -248,7 +248,7 @@ async function exportItems(server, modVersions, items) {
|
||||
|
||||
iconSheet.crop(0, 0, width, Math.ceil(pos / (width / size)) * size);
|
||||
|
||||
return {iconSheet, itemData};
|
||||
return { iconSheet, itemData };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,7 +338,7 @@ async function exportData(server) {
|
||||
throw new Error("No items got exported");
|
||||
}
|
||||
|
||||
let {iconSheet, itemData} = await exportItems(server, modVersions, items);
|
||||
let { iconSheet, itemData } = await exportItems(server, modVersions, items);
|
||||
let locale = await exportLocale(server, modVersions, modOrder, "en");
|
||||
|
||||
// Free up the memory used by zip files loaded during the export.
|
||||
|
||||
@@ -282,7 +282,7 @@ async function patch(savePath, modules) {
|
||||
root.file("clusterio.json", JSON.stringify(patchInfo, null, 4));
|
||||
|
||||
// Write back the save
|
||||
let stream = zip.generateNodeStream({compression: "DEFLATE"});
|
||||
let stream = zip.generateNodeStream({ compression: "DEFLATE" });
|
||||
let pipe = stream.pipe(fs.createWriteStream(savePath));
|
||||
await events.once(pipe, "finish");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = async function({
|
||||
log("Generating SSL certificate with "+bits+" bits at "+sslCertPath);
|
||||
|
||||
let startNs = hrtime();
|
||||
let keypair = await util.promisify(forge.pki.rsa.generateKeyPair)({bits: bits, e: 0x10001});
|
||||
let keypair = await util.promisify(forge.pki.rsa.generateKeyPair)({ bits: bits, e: 0x10001 });
|
||||
log("Generated 2048bit keypair in: "+(Number(hrtime()-startNs) / 1e6)+" ms");
|
||||
|
||||
startNs = hrtime();
|
||||
|
||||
@@ -79,7 +79,7 @@ class Request extends Message {
|
||||
|
||||
if (forwardTo === "instance") {
|
||||
requestProperties = Object.assign(
|
||||
{"instance_id": { type: "integer" }}, requestProperties
|
||||
{ "instance_id": { type: "integer" }}, requestProperties
|
||||
);
|
||||
|
||||
} else if (forwardTo !== "master" && forwardTo !== null) {
|
||||
@@ -185,7 +185,7 @@ class Request extends Message {
|
||||
response = {};
|
||||
}
|
||||
|
||||
if (!this._responseValidator({ seq: 0, type: this.responseType, response})) {
|
||||
if (!this._responseValidator({ seq: 0, type: this.responseType, response })) {
|
||||
console.error(this._responseValidator.errors);
|
||||
throw new Error(`Validation failed responding to ${this.requestType}`);
|
||||
}
|
||||
@@ -212,7 +212,7 @@ class Request extends Message {
|
||||
*/
|
||||
async send(link, data = {}) {
|
||||
// XXX validate link target/source?
|
||||
if (!this._requestValidator({ seq: 0, type: this.requestType, data})) {
|
||||
if (!this._requestValidator({ seq: 0, type: this.requestType, data })) {
|
||||
console.error(this._requestValidator.errors);
|
||||
throw new Error(`Validation failed sending ${this.requestType}`);
|
||||
}
|
||||
@@ -634,7 +634,7 @@ class Event extends Message {
|
||||
|
||||
if (forwardTo === "instance") {
|
||||
eventProperties = Object.assign(
|
||||
{"instance_id": { type: "integer" }}, eventProperties
|
||||
{ "instance_id": { type: "integer" }}, eventProperties
|
||||
);
|
||||
|
||||
} else if (forwardTo !== "master" && forwardTo !== null) {
|
||||
@@ -728,7 +728,7 @@ class Event extends Message {
|
||||
* Sends the given event data over the link.
|
||||
*/
|
||||
send(link, data = {}) {
|
||||
if (!this._eventValidator({ seq: 0, type: this.eventType, data})) {
|
||||
if (!this._eventValidator({ seq: 0, type: this.eventType, data })) {
|
||||
console.error(this._eventValidator.errors);
|
||||
throw new Error(`Validation failed sending ${this.eventType}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user