fix: clean up api key validation

This commit is contained in:
Peter Steinberger
2026-01-13 05:12:19 +00:00
parent f94ad21f1e
commit 8eb1c76337

View File

@@ -97,8 +97,11 @@ function normalizeApiKeyInput(raw: string): string {
return withoutSemicolon.trim();
}
const validateApiKeyInput = (value: unknown) =>
normalizeApiKeyInput(String(value ?? "")).length > 0 ? undefined : "Required";
const validateApiKeyInput = (value: unknown) => {
const normalized =
typeof value === "string" ? normalizeApiKeyInput(value) : "";
return normalized.length > 0 ? undefined : "Required";
};
const validateRequiredInput = (value: string) =>
value.trim().length > 0 ? undefined : "Required";