react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / object / assign.js
80742 viewsvar assignWith = require('../internal/assignWith'),1baseAssign = require('../internal/baseAssign'),2createAssigner = require('../internal/createAssigner');34/**5* Assigns own enumerable properties of source object(s) to the destination6* object. Subsequent sources overwrite property assignments of previous sources.7* If `customizer` is provided it is invoked to produce the assigned values.8* The `customizer` is bound to `thisArg` and invoked with five arguments:9* (objectValue, sourceValue, key, object, source).10*11* **Note:** This method mutates `object` and is based on12* [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).13*14* @static15* @memberOf _16* @alias extend17* @category Object18* @param {Object} object The destination object.19* @param {...Object} [sources] The source objects.20* @param {Function} [customizer] The function to customize assigned values.21* @param {*} [thisArg] The `this` binding of `customizer`.22* @returns {Object} Returns `object`.23* @example24*25* _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });26* // => { 'user': 'fred', 'age': 40 }27*28* // using a customizer callback29* var defaults = _.partialRight(_.assign, function(value, other) {30* return _.isUndefined(value) ? other : value;31* });32*33* defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });34* // => { 'user': 'barney', 'age': 36 }35*/36var assign = createAssigner(function(object, source, customizer) {37return customizer38? assignWith(object, source, customizer)39: baseAssign(object, source);40});4142module.exports = assign;434445