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

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
+7 -5
View File
@@ -175,9 +175,7 @@ function enqueueFileWrite(
sanitize: boolean,
jsonLine = false,
): void {
const line = jsonLine
? JSON.stringify(entry)
: formatLogEntry(entry, { color: false, sanitize })
const line = jsonLine ? JSON.stringify(entry) : formatLogEntry(entry, { color: false, sanitize })
const dateKey = extractLogDateKey(entry.time)
writeQueue = writeQueue
@@ -279,7 +277,9 @@ export function resolveLogFilePath(channel = 'app', time = new Date().toISOStrin
}
function normalizeLogChannelName(value: unknown): string {
const normalized = String(value || '').trim().toLowerCase()
const normalized = String(value || '')
.trim()
.toLowerCase()
if (!normalized) {
return 'app'
}
@@ -344,7 +344,9 @@ function normalizeLogValue(value: unknown, sanitize = true): unknown {
try {
return sanitize
? sanitizeLogValue(JSON.parse(JSON.stringify(value, (_key, current) => normalizeCurrent(current))))
? sanitizeLogValue(
JSON.parse(JSON.stringify(value, (_key, current) => normalizeCurrent(current))),
)
: JSON.parse(JSON.stringify(value, (_key, current) => normalizeCurrent(current)))
} catch {
return sanitize ? sanitizeLogString(String(value)) : String(value)