mirror of https://github.com/lukechilds/docs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
673 B
24 lines
673 B
var _assign = require('./internal/_assign');
|
|
var _curry1 = require('./internal/_curry1');
|
|
|
|
|
|
/**
|
|
* Merges a list of objects together into one object.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.10.0
|
|
* @category List
|
|
* @sig [{k: v}] -> {k: v}
|
|
* @param {Array} list An array of objects
|
|
* @return {Object} A merged object.
|
|
* @see R.reduce
|
|
* @example
|
|
*
|
|
* R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=> {foo:1,bar:2,baz:3}
|
|
* R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=> {foo:2,bar:2}
|
|
* @symb R.mergeAll([{ x: 1 }, { y: 2 }, { z: 3 }]) = { x: 1, y: 2, z: 3 }
|
|
*/
|
|
module.exports = _curry1(function mergeAll(list) {
|
|
return _assign.apply(null, [{}].concat(list));
|
|
});
|
|
|