address greptile review feedback (greploop iteration 2)

Replace unsafe `as string[]` cast in modeMatches with runtime type
check via `.some()`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-18 12:34:03 -07:00
parent 1c8b5f77c9
commit 6902355f5b

View file

@ -107,7 +107,7 @@ const modeMatches = (
if (typeof mode === "object" && "default" in mode) {
const def = mode.default;
if (typeof def === "string") return def === target;
if (Array.isArray(def)) return (def as string[]).includes(target);
if (Array.isArray(def)) return def.some((x) => typeof x === "string" && x === target);
}
return false;
};