source: node_modules/ramda/es/mergeAll.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: 852 bytes
Line 
1import _objectAssign from "./internal/_objectAssign.js";
2import _curry1 from "./internal/_curry1.js";
3/**
4 * Creates one new object with the own properties from a list of objects.
5 * If a key exists in more than one object, the value from the last
6 * object it exists in will be used.
7 *
8 * @func
9 * @memberOf R
10 * @since v0.10.0
11 * @category List
12 * @sig [{k: v}] -> {k: v}
13 * @param {Array} list An array of objects
14 * @return {Object} A merged object.
15 * @see R.reduce
16 * @example
17 *
18 * R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=> {foo:1,bar:2,baz:3}
19 * R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=> {foo:2,bar:2}
20 * @symb R.mergeAll([{ x: 1 }, { y: 2 }, { z: 3 }]) = { x: 1, y: 2, z: 3 }
21 */
22
23var mergeAll =
24/*#__PURE__*/
25_curry1(function mergeAll(list) {
26 return _objectAssign.apply(null, [{}].concat(list));
27});
28
29export default mergeAll;
Note: See TracBrowser for help on using the repository browser.