UNPKG

987 BJavaScriptView Raw
1var _objectAssign =
2/*#__PURE__*/
3require("./internal/_objectAssign");
4
5var _curry2 =
6/*#__PURE__*/
7require("./internal/_curry2");
8/**
9 * Create 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 * the value from the second object will be used.
12 *
13 * @func
14 * @memberOf R
15 * @since v0.26.0
16 * @category Object
17 * @sig {k: v} -> {k: v} -> {k: v}
18 * @param {Object} l
19 * @param {Object} r
20 * @return {Object}
21 * @see R.mergeLeft, R.mergeDeepRight, R.mergeWith, R.mergeWithKey
22 * @example
23 *
24 * R.mergeRight({ 'name': 'fred', 'age': 10 }, { 'age': 40 });
25 * //=> { 'name': 'fred', 'age': 40 }
26 *
27 * const withDefaults = R.mergeRight({x: 0, y: 0});
28 * withDefaults({y: 2}); //=> {x: 0, y: 2}
29 * @symb R.mergeRight(a, b) = {...a, ...b}
30 */
31
32
33var mergeRight =
34/*#__PURE__*/
35_curry2(function mergeRight(l, r) {
36 return _objectAssign({}, l, r);
37});
38
39module.exports = mergeRight;
\No newline at end of file