mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:31:35 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -7,7 +7,9 @@ export type GatewayDiscoverOpts = {
|
||||
};
|
||||
|
||||
export function parseDiscoverTimeoutMs(raw: unknown, fallbackMs: number): number {
|
||||
if (raw === undefined || raw === null) return fallbackMs;
|
||||
if (raw === undefined || raw === null) {
|
||||
return fallbackMs;
|
||||
}
|
||||
const value =
|
||||
typeof raw === "string"
|
||||
? raw.trim()
|
||||
@@ -17,7 +19,9 @@ export function parseDiscoverTimeoutMs(raw: unknown, fallbackMs: number): number
|
||||
if (value === null) {
|
||||
throw new Error("invalid --timeout");
|
||||
}
|
||||
if (!value) return fallbackMs;
|
||||
if (!value) {
|
||||
return fallbackMs;
|
||||
}
|
||||
const parsed = Number.parseInt(value, 10);
|
||||
if (!Number.isFinite(parsed) || parsed <= 0) {
|
||||
throw new Error(`invalid --timeout: ${value}`);
|
||||
@@ -48,7 +52,9 @@ export function dedupeBeacons(beacons: GatewayBonjourBeacon[]): GatewayBonjourBe
|
||||
String(b.port ?? ""),
|
||||
String(b.gatewayPort ?? ""),
|
||||
].join("|");
|
||||
if (seen.has(key)) continue;
|
||||
if (seen.has(key)) {
|
||||
continue;
|
||||
}
|
||||
seen.add(key);
|
||||
out.push(b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user