统一前后端代码格式化配置

This commit is contained in:
yml2213
2026-08-16 17:27:12 +08:00
parent 8705f6a6a1
commit 5c7c3e14e3
278 changed files with 6386 additions and 5500 deletions
@@ -51,9 +51,10 @@ export async function ensureShortLinkForTarget(
}
const targetUrlHash = hashTargetUrl(normalizedTargetUrl)
const now = nowIso()
const expiresAt = options.expiresAt !== undefined
? normalizeNullableIso(options.expiresAt)
: addHours(now, DEFAULT_SHORT_LINK_TTL_HOURS)
const expiresAt =
options.expiresAt !== undefined
? normalizeNullableIso(options.expiresAt)
: addHours(now, DEFAULT_SHORT_LINK_TTL_HOURS)
for (let attempt = 1; attempt <= SHORT_LINK_MAX_CREATE_ATTEMPTS; attempt += 1) {
try {
@@ -241,9 +242,10 @@ function isShortLinkExpired(row: ShortLinkRow): boolean {
}
function isShortLinkCodeConflict(error: unknown): boolean {
const current = error && typeof error === 'object'
? error as { code?: unknown; constraint?: unknown; detail?: unknown }
: {}
const current =
error && typeof error === 'object'
? (error as { code?: unknown; constraint?: unknown; detail?: unknown })
: {}
if (String(current.code || '') !== '23505') {
return false
}