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

@@ -33,13 +33,19 @@ import { isNodeCommandAllowed, resolveNodeCommandAllowlist } from "../node-comma
import type { GatewayRequestHandlers } from "./types.js";
function isNodeEntry(entry: { role?: string; roles?: string[] }) {
if (entry.role === "node") return true;
if (Array.isArray(entry.roles) && entry.roles.includes("node")) return true;
if (entry.role === "node") {
return true;
}
if (Array.isArray(entry.roles) && entry.roles.includes("node")) {
return true;
}
return false;
}
function normalizeNodeInvokeResultParams(params: unknown): unknown {
if (!params || typeof params !== "object") return params;
if (!params || typeof params !== "object") {
return params;
}
const raw = params as Record<string, unknown>;
const normalized: Record<string, unknown> = { ...raw };
if (normalized.payloadJSON === null) {
@@ -284,11 +290,17 @@ export const nodeHandlers: GatewayRequestHandlers = {
});
nodes.sort((a, b) => {
if (a.connected !== b.connected) return a.connected ? -1 : 1;
if (a.connected !== b.connected) {
return a.connected ? -1 : 1;
}
const an = (a.displayName ?? a.nodeId).toLowerCase();
const bn = (b.displayName ?? b.nodeId).toLowerCase();
if (an < bn) return -1;
if (an > bn) return 1;
if (an < bn) {
return -1;
}
if (an > bn) {
return 1;
}
return a.nodeId.localeCompare(b.nodeId);
});