统一前后端代码格式化配置
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user