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

@@ -1,14 +1,22 @@
import { parseTimeoutMs } from "./parse-timeout.js";
export function parseEnvPairs(pairs: unknown): Record<string, string> | undefined {
if (!Array.isArray(pairs) || pairs.length === 0) return undefined;
if (!Array.isArray(pairs) || pairs.length === 0) {
return undefined;
}
const env: Record<string, string> = {};
for (const pair of pairs) {
if (typeof pair !== "string") continue;
if (typeof pair !== "string") {
continue;
}
const idx = pair.indexOf("=");
if (idx <= 0) continue;
if (idx <= 0) {
continue;
}
const key = pair.slice(0, idx).trim();
if (!key) continue;
if (!key) {
continue;
}
env[key] = pair.slice(idx + 1);
}
return Object.keys(env).length > 0 ? env : undefined;