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