Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / defaults.js
1 var apply = require('./_apply'),
2     assignInDefaults = require('./_assignInDefaults'),
3     assignInWith = require('./assignInWith'),
4     rest = require('./rest');
5
6 /**
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.
11  *
12  * **Note:** This method mutates `object`.
13  *
14  * @static
15  * @memberOf _
16  * @category Object
17  * @param {Object} object The destination object.
18  * @param {...Object} [sources] The source objects.
19  * @returns {Object} Returns `object`.
20  * @example
21  *
22  * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
23  * // => { 'user': 'barney', 'age': 36 }
24  */
25 var defaults = rest(function(args) {
26   args.push(undefined, assignInDefaults);
27   return apply(assignInWith, undefined, args);
28 });
29
30 module.exports = defaults;