mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 22:21:23 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -6,7 +6,9 @@ export const DEFAULT_TOKEN_PROFILE_NAME = "default";
|
||||
|
||||
export function normalizeTokenProfileName(raw: string): string {
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed) return DEFAULT_TOKEN_PROFILE_NAME;
|
||||
if (!trimmed) {
|
||||
return DEFAULT_TOKEN_PROFILE_NAME;
|
||||
}
|
||||
const slug = trimmed
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9._-]+/g, "-")
|
||||
@@ -23,7 +25,9 @@ export function buildTokenProfileId(params: { provider: string; name: string }):
|
||||
|
||||
export function validateAnthropicSetupToken(raw: string): string | undefined {
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed) return "Required";
|
||||
if (!trimmed) {
|
||||
return "Required";
|
||||
}
|
||||
if (!trimmed.startsWith(ANTHROPIC_SETUP_TOKEN_PREFIX)) {
|
||||
return `Expected token starting with ${ANTHROPIC_SETUP_TOKEN_PREFIX}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user