- Preparing search index...
- The search index is not available
@giraugh/tools
Function mergeObjectValuesBy
- mergeObjectValuesBy<TKeys, TObj>(objects, mergeFn): TObj
-
Type Parameters
-
TKeys extends PropertyKey
-
TObj extends Record<TKeys, any>
Parameters
-
objects: TObj[]
-
mergeFn: ((a, b) => TObj[TKeys])
-
- (a, b): TObj[TKeys]
-
Parameters
-
a: TObj[TKeys]
-
b: TObj[TKeys]
Returns TObj[TKeys]
Returns TObj
Merge the values of an array of objects using the specified merging function
Example