Fix code style errors

Remove extra whitespace, use more consistent spacing, add missing
semicolons, using dangling commas, break up long lines, consistent
multiline operator placement, add missing JSDoc strings and so on.
This commit is contained in:
Hornwitser committed 2023-11-19 04:48:38 +01:00
1 parent 97e05c0610
commit 7314dc99c8
71 files changed
+403 -290

No files matched your search

-1
View File
@@ -1,4 +1,3 @@
"use strict";
import zlib from "zlib";
import { Type, Static } from "@sinclair/typebox";
+1 -1
View File
@@ -1,7 +1,7 @@
import { Type } from "@sinclair/typebox";
export function StringEnum<T extends string[]>(values: [...T]) {
return Type.Unsafe<T[number]>({ type: 'string', enum: values })
return Type.Unsafe<T[number]>({ type: "string", enum: values });
}
export interface JSONDeserialisable<T> {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { ValidateFunction } from "ajv";
import type { Message } from "./messages_core";
var message_validate: ValidateFunction<Message>;
const message_validate: ValidateFunction<Message>;
export default message_validate;
@@ -166,6 +166,7 @@ export class LogQueryRequest {
json.all, json.controller, json.hostIds, json.instanceIds, json.maxLevel, json.limit, json.order
);
}
static Response = class Response {
constructor(
public log: object[],
+9 -1
View File
@@ -23,7 +23,15 @@ export class HostDetails {
});
static fromJSON(json: Static<typeof this.jsonSchema>) {
return new this(json.agent, json.version, json.name, json.id, json.connected, json.publicAddress, json.tokenValidAfter);
return new this(
json.agent,
json.version,
json.name,
json.id,
json.connected,
json.publicAddress,
json.tokenValidAfter,
);
}
}
+1 -1
View File
@@ -211,7 +211,7 @@ export class RawUser { // TODO refactor into lib/user.User
isDeleted: this.isDeleted,
};
if (this.playerStats) {
json.playerStats = this.playerStats.toJSON()
json.playerStats = this.playerStats.toJSON();
}
if (this.instanceStats) {
json.instanceStats = [...this.instanceStats].map(([k, v]) => [k, v.toJSON()]);