@@ -40,16 +40,16 @@ export type ReturnType<T> = T extends (...args: unknown[]) => infer R ? R : neve
4040 * Deep merge utility for configuration updates
4141 * Recursively merges source into target, preserving nested objects
4242 */
43- export function deepMerge < T extends Record < string , unknown > > (
43+ export function deepMerge < T extends object > (
4444 target : T ,
4545 source : DeepPartial < T >
4646) : T {
4747 const result = { ...target } as T ;
4848
4949 for ( const key in source ) {
5050 if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
51- const sourceValue = source [ key ] ;
52- const targetValue = target [ key ] ;
51+ const sourceValue = source [ key as keyof typeof source ] ;
52+ const targetValue = target [ key as unknown as keyof T ] ;
5353
5454 if (
5555 sourceValue !== undefined &&
@@ -62,8 +62,8 @@ export function deepMerge<T extends Record<string, unknown>>(
6262 ! Array . isArray ( targetValue )
6363 ) {
6464 ( result as Record < string , unknown > ) [ key ] = deepMerge (
65- targetValue as Record < string , unknown > ,
66- sourceValue as DeepPartial < Record < string , unknown > >
65+ targetValue as object ,
66+ sourceValue as DeepPartial < object >
6767 ) ;
6868 } else if ( sourceValue !== undefined ) {
6969 ( result as Record < string , unknown > ) [ key ] = sourceValue ;
0 commit comments