@univerjscorefunctionsMerge

@univerjs/core v0.5.4


Function: merge()

Call Signature

function merge<TObject, TSource>(object, source): TObject & TSource

Defined in: packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1838

Recursively merges own and inherited enumerable properties of source objects into the destination object, skipping source properties that resolve to undefined. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

Note: This method mutates object.

Type Parameters

Type Parameter
TObject
TSource

Parameters

ParameterTypeDescription
objectTObjectThe destination object.
sourceTSource-

Returns

TObject & TSource

Returns object.

Example

var users = {
  'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
};
 
var ages = {
  'data': [{ 'age': 36 }, { 'age': 40 }]
};
 
_.merge(users, ages);
// => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }

Call Signature

function merge<TObject, TSource1, TSource2>(
   object, 
   source1, 
   source2): TObject & TSource1 & TSource2

Defined in: packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1842

Type Parameters

Type Parameter
TObject
TSource1
TSource2

Parameters

ParameterType
objectTObject
source1TSource1
source2TSource2

Returns

TObject & TSource1 & TSource2

See

_.merge

Call Signature

function merge<TObject, TSource1, TSource2, TSource3>(
   object, 
   source1, 
   source2, 
   source3): TObject & TSource1 & TSource2 & TSource3

Defined in: packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1846

Type Parameters

Type Parameter
TObject
TSource1
TSource2
TSource3

Parameters

ParameterType
objectTObject
source1TSource1
source2TSource2
source3TSource3

Returns

TObject & TSource1 & TSource2 & TSource3

See

_.merge

Call Signature

function merge<TObject, TSource1, TSource2, TSource3, TSource4>(
   object, 
   source1, 
   source2, 
   source3, 
   source4): TObject & TSource1 & TSource2 & TSource3 & TSource4

Defined in: packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1850

Type Parameters

Type Parameter
TObject
TSource1
TSource2
TSource3
TSource4

Parameters

ParameterType
objectTObject
source1TSource1
source2TSource2
source3TSource3
source4TSource4

Returns

TObject & TSource1 & TSource2 & TSource3 & TSource4

See

_.merge

Call Signature

function merge(object, ...otherArgs): any

Defined in: packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1854

Parameters

ParameterType
objectany
otherArgsany[]

Returns

any

See

_.merge