fix: clean up api key validation
This commit is contained in:
parent
f94ad21f1e
commit
8eb1c76337
1 changed files with 5 additions and 2 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue