From 0a8ceb9e6349284e75545a01ffad608b020f78e2 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Mon, 11 Dec 2023 01:12:54 +0100 Subject: Actually run prettier --- src/gateway/util/Send.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/gateway/util/Send.ts') diff --git a/src/gateway/util/Send.ts b/src/gateway/util/Send.ts index 57f87d8b..86f75a9a 100644 --- a/src/gateway/util/Send.ts +++ b/src/gateway/util/Send.ts @@ -37,15 +37,13 @@ const recurseJsonReplace = (json: any) => { json[key] = JSONReplacer.call(json, key, json[key]); - if (typeof json[key] == "object" && json[key] !== null) - json[key] = recurseJsonReplace(json[key]); + if (typeof json[key] == "object" && json[key] !== null) json[key] = recurseJsonReplace(json[key]); } return json; }; export function Send(socket: WebSocket, data: Payload) { - if (process.env.WS_VERBOSE) - console.log(`[Websocket] Outgoing message: ${JSON.stringify(data)}`); + if (process.env.WS_VERBOSE) console.log(`[Websocket] Outgoing message: ${JSON.stringify(data)}`); if (process.env.WS_DUMP) { const id = socket.session_id || "unknown"; @@ -54,10 +52,7 @@ export function Send(socket: WebSocket, data: Payload) { await fs.mkdir(path.join("dump", id), { recursive: true, }); - await fs.writeFile( - path.join("dump", id, `${Date.now()}.out.json`), - JSON.stringify(data, null, 2), - ); + await fs.writeFile(path.join("dump", id, `${Date.now()}.out.json`), JSON.stringify(data, null, 2)); })(); } @@ -68,8 +63,7 @@ export function Send(socket: WebSocket, data: Payload) { buffer = erlpack.pack(data); } // TODO: encode circular object - else if (socket.encoding === "json") - buffer = JSON.stringify(data, JSONReplacer); + else if (socket.encoding === "json") buffer = JSON.stringify(data, JSONReplacer); else return; // TODO: compression if (socket.deflate) { -- cgit 1.5.1