chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -95,7 +95,9 @@ export function attachGatewayWsConnectionHandler(params: {
let lastFrameId: string | undefined;
const setCloseCause = (cause: string, meta?: Record<string, unknown>) => {
if (!closeCause) closeCause = cause;
if (!closeCause) {
closeCause = cause;
}
if (meta && Object.keys(meta).length > 0) {
closeMeta = { ...closeMeta, ...meta };
}
@@ -125,10 +127,14 @@ export function attachGatewayWsConnectionHandler(params: {
});
const close = (code = 1000, reason?: string) => {
if (closed) return;
if (closed) {
return;
}
closed = true;
clearTimeout(handshakeTimer);
if (client) clients.delete(client);
if (client) {
clients.delete(client);
}
try {
socket.close(code, reason);
} catch {