main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | var _curry2 =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_curry2.js");
|
---|
4 |
|
---|
5 | var mergeDeepWithKey =
|
---|
6 | /*#__PURE__*/
|
---|
7 | require("./mergeDeepWithKey.js");
|
---|
8 | /**
|
---|
9 | * Creates a new object with the own properties of the first object merged with
|
---|
10 | * the own properties of the second object. If a key exists in both objects:
|
---|
11 | * - and both values are objects, the two values will be recursively merged
|
---|
12 | * - otherwise the value from the second object will be used.
|
---|
13 | *
|
---|
14 | * @func
|
---|
15 | * @memberOf R
|
---|
16 | * @since v0.24.0
|
---|
17 | * @category Object
|
---|
18 | * @sig {a} -> {a} -> {a}
|
---|
19 | * @param {Object} lObj
|
---|
20 | * @param {Object} rObj
|
---|
21 | * @return {Object}
|
---|
22 | * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey
|
---|
23 | * @example
|
---|
24 | *
|
---|
25 | * R.mergeDeepRight({ name: 'fred', age: 10, contact: { email: 'moo@example.com' }},
|
---|
26 | * { age: 40, contact: { email: 'baa@example.com' }});
|
---|
27 | * //=> { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}
|
---|
28 | */
|
---|
29 |
|
---|
30 |
|
---|
31 | var mergeDeepRight =
|
---|
32 | /*#__PURE__*/
|
---|
33 | _curry2(function mergeDeepRight(lObj, rObj) {
|
---|
34 | return mergeDeepWithKey(function (k, lVal, rVal) {
|
---|
35 | return rVal;
|
---|
36 | }, lObj, rObj);
|
---|
37 | });
|
---|
38 |
|
---|
39 | module.exports = mergeDeepRight; |
---|
Note:
See
TracBrowser
for help on using the repository browser.