source: node_modules/ramda/es/mergeLeft.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: 952 bytes
Line 
1import _objectAssign from "./internal/_objectAssign.js";
2import _curry2 from "./internal/_curry2.js";
3/**
4 * Create 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 * the value from the first object will be used.
7 *
8 * @func
9 * @memberOf R
10 * @since v0.26.0
11 * @category Object
12 * @sig {k: v} -> {k: v} -> {k: v}
13 * @param {Object} l
14 * @param {Object} r
15 * @return {Object}
16 * @see R.mergeRight, R.mergeDeepLeft, R.mergeWith, R.mergeWithKey
17 * @example
18 *
19 * R.mergeLeft({ 'age': 40 }, { 'name': 'fred', 'age': 10 });
20 * //=> { 'name': 'fred', 'age': 40 }
21 *
22 * const resetToDefault = R.mergeLeft({x: 0});
23 * resetToDefault({x: 5, y: 2}); //=> {x: 0, y: 2}
24 * @symb R.mergeLeft(a, b) = {...b, ...a}
25 */
26
27var mergeLeft =
28/*#__PURE__*/
29_curry2(function mergeLeft(l, r) {
30 return _objectAssign({}, r, l);
31});
32
33export default mergeLeft;
Note: See TracBrowser for help on using the repository browser.