彻底重构-1
This commit is contained in:
@@ -127,6 +127,10 @@ function defaultErrorCodeForStatus(statusCode) {
|
||||
}
|
||||
|
||||
function normalizeResponseDateTime(value) {
|
||||
if (value instanceof Date) {
|
||||
return formatResponseDateTime(value.toISOString())
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
return value.map((item) => normalizeResponseDateTime(item))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { existsSync } from 'node:fs'
|
||||
import fs from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
@@ -90,17 +89,8 @@ function resolveConsoleMethod(level) {
|
||||
}
|
||||
|
||||
function resolveDataRoot() {
|
||||
const configuredDatabasePath = String(runtimeConfig.database?.filePath || '').trim()
|
||||
|
||||
if (configuredDatabasePath) {
|
||||
const configuredDataRoot = path.dirname(configuredDatabasePath)
|
||||
|
||||
if (existsSync(configuredDataRoot)) {
|
||||
return configuredDataRoot
|
||||
}
|
||||
}
|
||||
|
||||
return path.resolve(PROJECT_ROOT, 'data')
|
||||
const configured = String(runtimeConfig.data?.root || '').trim()
|
||||
return configured ? path.resolve(configured) : path.resolve(PROJECT_ROOT, 'data')
|
||||
}
|
||||
|
||||
function normalizeLogValue(value) {
|
||||
|
||||
Reference in New Issue
Block a user