Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / assign.js
1 var copyObject = require('./internal/copyObject'),
2     createAssigner = require('./internal/createAssigner'),
3     keys = require('./keys');
4
5 /**
6  * Assigns own enumerable properties of source objects to the destination
7  * object. Source objects are applied from left to right. Subsequent sources
8  * overwrite property assignments of previous sources.
9  *
10  * **Note:** This method mutates `object` and is loosely based on
11  * [`Object.assign`](https://mdn.io/Object/assign).
12  *
13  * @static
14  * @memberOf _
15  * @category Object
16  * @param {Object} object The destination object.
17  * @param {...Object} [sources] The source objects.
18  * @returns {Object} Returns `object`.
19  * @example
20  *
21  * function Foo() {
22  *   this.c = 3;
23  * }
24  *
25  * function Bar() {
26  *   this.e = 5;
27  * }
28  *
29  * Foo.prototype.d = 4;
30  * Bar.prototype.f = 6;
31  *
32  * _.assign({ 'a': 1 }, new Foo, new Bar);
33  * // => { 'a': 1, 'c': 3, 'e': 5 }
34  */
35 var assign = createAssigner(function(object, source) {
36   copyObject(source, keys(source), object);
37 });
38
39 module.exports = assign;