1 var assign = require('./assign'),
2 assignDefaults = require('../internal/assignDefaults'),
3 restParam = require('../function/restParam');
6 * Assigns own enumerable properties of source object(s) to the destination
7 * object for all destination properties that resolve to `undefined`. Once a
8 * property is set, additional values of the same property are ignored.
10 * **Note:** This method mutates `object`.
15 * @param {Object} object The destination object.
16 * @param {...Object} [sources] The source objects.
17 * @returns {Object} Returns `object`.
20 * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
21 * // => { 'user': 'barney', 'age': 36 }
23 var defaults = restParam(function(args) {
28 args.push(assignDefaults);
29 return assign.apply(undefined, args);
32 module.exports = defaults;