diff options
Diffstat (limited to 'tools/eslint/node_modules/lodash/assign.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/assign.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/lodash/assign.js b/tools/eslint/node_modules/lodash/assign.js new file mode 100644 index 0000000000..d766dd0c4a --- /dev/null +++ b/tools/eslint/node_modules/lodash/assign.js @@ -0,0 +1,39 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keys = require('./keys'); + +/** + * Assigns own enumerable properties of source objects to the destination + * object. Source objects are applied from left to right. Subsequent sources + * overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ +var assign = createAssigner(function(object, source) { + copyObject(source, keys(source), object); +}); + +module.exports = assign; |