mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
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:
parent
1c8b5f77c9
commit
6902355f5b
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue