@aws/pdk
Version:
All documentation is located at: https://aws.github.io/aws-pdk
35 lines (31 loc) • 890 B
JavaScript
var _objectAssign =
/*#__PURE__*/
require("./internal/_objectAssign.js");
var _curry1 =
/*#__PURE__*/
require("./internal/_curry1.js");
/**
* Creates one new object with the own properties from a list of objects.
* If a key exists in more than one object, the value from the last
* object it exists in will be used.
*
* @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 }
*/
var mergeAll =
/*#__PURE__*/
_curry1(function mergeAll(list) {
return _objectAssign.apply(null, [{}].concat(list));
});
module.exports = mergeAll;