1 var apply = require('./internal/apply'),
2 assignInDefaults = require('./internal/assignInDefaults'),
3 assignInWith = require('./assignInWith'),
4 rest = require('./rest');
7 * Assigns own and inherited enumerable properties of source objects to the
8 * destination object for all destination properties that resolve to `undefined`.
9 * Source objects are applied from left to right. Once a property is set,
10 * additional values of the same property are ignored.
12 * **Note:** This method mutates `object`.
17 * @param {Object} object The destination object.
18 * @param {...Object} [sources] The source objects.
19 * @returns {Object} Returns `object`.
22 * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
23 * // => { 'user': 'barney', 'age': 36 }
25 var defaults = rest(function(args) {
26 args.push(undefined, assignInDefaults);
27 return apply(assignInWith, undefined, args);
30 module.exports = defaults;