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

@@ -12,8 +12,12 @@ const DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
export function normalizeOpenAiModel(model: string): string {
const trimmed = model.trim();
if (!trimmed) return DEFAULT_OPENAI_EMBEDDING_MODEL;
if (trimmed.startsWith("openai/")) return trimmed.slice("openai/".length);
if (!trimmed) {
return DEFAULT_OPENAI_EMBEDDING_MODEL;
}
if (trimmed.startsWith("openai/")) {
return trimmed.slice("openai/".length);
}
return trimmed;
}
@@ -24,7 +28,9 @@ export async function createOpenAiEmbeddingProvider(
const url = `${client.baseUrl.replace(/\/$/, "")}/embeddings`;
const embed = async (input: string[]): Promise<number[][]> => {
if (input.length === 0) return [];
if (input.length === 0) {
return [];
}
const res = await fetch(url, {
method: "POST",
headers: client.headers,