fix: resolve code quality issues in utility functions

- Fix TypeScript type error in deepMerge recursive call with proper type assertions
- Remove unused type imports (ErpConfig, DatabaseConfig, PathsConfig, ExtractionConfig, ValidationConfig, UiConfig, ExecutionConfig)
- Fix line endings (CRLF to LF) via Prettier format

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-03-03 12:53:46 +08:00
parent 765fb95644
commit c06880e946

View File

@@ -11,13 +11,6 @@ import { fileURLToPath } from 'url'
import { dirname } from 'path'
import type {
SettingsData,
ErpConfig,
DatabaseConfig,
PathsConfig,
ExtractionConfig,
ValidationConfig,
UiConfig,
ExecutionConfig,
DatabaseType,
MatchMode,
ValidationDataSource
@@ -96,7 +89,10 @@ function deepMerge<T>(source: T, target: Partial<T>): T {
const sourceValue = result[key]
if (isObject(targetValue) && isObject(sourceValue)) {
result[key] = deepMerge(sourceValue, targetValue)
result[key] = deepMerge(
sourceValue as T[Extract<keyof T, string>],
targetValue as Partial<T[Extract<keyof T, string>]>
)
} else if (targetValue !== undefined) {
result[key] = targetValue as T[Extract<keyof T, string>]
}
@@ -113,7 +109,7 @@ function deepMerge<T>(source: T, target: Partial<T>): T {
const UI_EDITABLE_FIELDS: string[] = [
'erp.url',
'erp.username',
'erp.password',
'erp.password'
// Add more fields as UI expands
]