@univerjs/core v0.5.0-beta.1 • Docs
Function: merge()
merge(object, source)
function merge<TObject, TSource>(object, source): TObject & TSource
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
Parameter | Type | Description |
---|---|---|
object | TObject | The destination object. |
source | TSource | - |
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 }] }
Defined in
packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1838
merge(object, source1, source2)
function merge<TObject, TSource1, TSource2>(
object,
source1,
source2): TObject & TSource1 & TSource2
Type Parameters
Type Parameter |
---|
TObject |
TSource1 |
TSource2 |
Parameters
Parameter | Type |
---|---|
object | TObject |
source1 | TSource1 |
source2 | TSource2 |
Returns
TObject
& TSource1
& TSource2
See
_.merge
Defined in
packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1842
merge(object, source1, source2, source3)
function merge<TObject, TSource1, TSource2, TSource3>(
object,
source1,
source2,
source3): TObject & TSource1 & TSource2 & TSource3
Type Parameters
Type Parameter |
---|
TObject |
TSource1 |
TSource2 |
TSource3 |
Parameters
Parameter | Type |
---|---|
object | TObject |
source1 | TSource1 |
source2 | TSource2 |
source3 | TSource3 |
Returns
TObject
& TSource1
& TSource2
& TSource3
See
_.merge
Defined in
packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1846
merge(object, source1, source2, source3, source4)
function merge<TObject, TSource1, TSource2, TSource3, TSource4>(
object,
source1,
source2,
source3,
source4): TObject & TSource1 & TSource2 & TSource3 & TSource4
Type Parameters
Type Parameter |
---|
TObject |
TSource1 |
TSource2 |
TSource3 |
TSource4 |
Parameters
Parameter | Type |
---|---|
object | TObject |
source1 | TSource1 |
source2 | TSource2 |
source3 | TSource3 |
source4 | TSource4 |
Returns
TObject
& TSource1
& TSource2
& TSource3
& TSource4
See
_.merge
Defined in
packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1850
merge(object, otherArgs)
function merge(object, ...otherArgs): any
Parameters
Parameter | Type |
---|---|
object | any |
…otherArgs | any [] |
Returns
any
See
_.merge
Defined in
packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:1854