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

@@ -39,17 +39,23 @@ const OPENAI_MODEL_APIS = new Set([
const OPENAI_PROVIDERS = new Set(["openai", "openai-codex"]);
function isOpenAiApi(modelApi?: string | null): boolean {
if (!modelApi) return false;
if (!modelApi) {
return false;
}
return OPENAI_MODEL_APIS.has(modelApi);
}
function isOpenAiProvider(provider?: string | null): boolean {
if (!provider) return false;
if (!provider) {
return false;
}
return OPENAI_PROVIDERS.has(normalizeProviderId(provider));
}
function isAnthropicApi(modelApi?: string | null, provider?: string | null): boolean {
if (modelApi === "anthropic-messages") return true;
if (modelApi === "anthropic-messages") {
return true;
}
const normalized = normalizeProviderId(provider ?? "");
// MiniMax now uses openai-completions API, not anthropic-messages
return normalized === "anthropic";
@@ -57,9 +63,13 @@ function isAnthropicApi(modelApi?: string | null, provider?: string | null): boo
function isMistralModel(params: { provider?: string | null; modelId?: string | null }): boolean {
const provider = normalizeProviderId(params.provider ?? "");
if (provider === "mistral") return true;
if (provider === "mistral") {
return true;
}
const modelId = (params.modelId ?? "").toLowerCase();
if (!modelId) return false;
if (!modelId) {
return false;
}
return MISTRAL_MODEL_HINTS.some((hint) => modelId.includes(hint));
}