Function deepMerge
- deepMerge<T extends object, U extends object>(
target: T,
sourceObj: U,
): DeepMerge<T, [U]> Type Parameters
Returns DeepMerge<T, [U]>
Target object.
- deepMerge<T extends object, U extends object, V extends object>(
target: T,
sourceObj1: U,
sourceObj2: V,
): DeepMerge<T, [U, V]> Recursively deep merges all source objects into the target object in place. Like
Object.assign
if you provide{}
as the target a shallow copy is produced. If the target and source property are object literals they are merged.Note: The output type is inferred, but you may provide explicit generic types as well.
Type Parameters
Returns DeepMerge<T, [U, V]>
Target object.
- deepMerge<T extends object, U extends object[]>(
target: T,
...sourceObj: U,
): DeepMerge<T, U> Recursively deep merges all source objects into the target object in place. Like
Object.assign
if you provide{}
as the target a shallow copy is produced. If the target and source property are object literals they are merged.Note: The output type is inferred, but you may provide explicit generic types as well.
Type Parameters
Returns DeepMerge<T, U>
Target object.
Recursively deep merges all source objects into the target object in place. Like
Object.assign
if you provide{}
as the target a shallow copy is produced. If the target and source property are object literals they are merged.Note: The output type is inferred, but you may provide explicit generic types as well.