source: node_modules/ramda/es/mergeDeepRight.js

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 
1import _curry2 from "./internal/_curry2.js";
2import mergeDeepWithKey from "./mergeDeepWithKey.js";
3/**
4 * Creates a new object with the own properties of the first object merged with
5 * the own properties of the second object. If a key exists in both objects:
6 * - and both values are objects, the two values will be recursively merged
7 * - otherwise the value from the second object will be used.
8 *
9 * @func
10 * @memberOf R
11 * @since v0.24.0
12 * @category Object
13 * @sig {a} -> {a} -> {a}
14 * @param {Object} lObj
15 * @param {Object} rObj
16 * @return {Object}
17 * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey
18 * @example
19 *
20 * R.mergeDeepRight({ name: 'fred', age: 10, contact: { email: 'moo@example.com' }},
21 * { age: 40, contact: { email: 'baa@example.com' }});
22 * //=> { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}
23 */
24
25var mergeDeepRight =
26/*#__PURE__*/
27_curry2(function mergeDeepRight(lObj, rObj) {
28 return mergeDeepWithKey(function (k, lVal, rVal) {
29 return rVal;
30 }, lObj, rObj);
31});
32
33export default mergeDeepRight;
Note: See TracBrowser for help on using the repository browser.