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:
993 bytes
|
Line | |
---|
1 | var _objectAssign =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_objectAssign.js");
|
---|
4 |
|
---|
5 | var _curry2 =
|
---|
6 | /*#__PURE__*/
|
---|
7 | require("./internal/_curry2.js");
|
---|
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 |
|
---|
33 | var mergeRight =
|
---|
34 | /*#__PURE__*/
|
---|
35 | _curry2(function mergeRight(l, r) {
|
---|
36 | return _objectAssign({}, l, r);
|
---|
37 | });
|
---|
38 |
|
---|
39 | module.exports = mergeRight; |
---|
Note:
See
TracBrowser
for help on using the repository browser.