Initial commit
[yaffs-website] / node_modules / sass-graph / node_modules / lodash / defaults.js
1 var apply = require('./_apply'),
2     assignInWith = require('./assignInWith'),
3     baseRest = require('./_baseRest'),
4     customDefaultsAssignIn = require('./_customDefaultsAssignIn');
5
6 /**
7  * Assigns own and inherited enumerable string keyed properties of source
8  * objects to the destination object for all destination properties that
9  * resolve to `undefined`. Source objects are applied from left to right.
10  * Once a property is set, additional values of the same property are ignored.
11  *
12  * **Note:** This method mutates `object`.
13  *
14  * @static
15  * @since 0.1.0
16  * @memberOf _
17  * @category Object
18  * @param {Object} object The destination object.
19  * @param {...Object} [sources] The source objects.
20  * @returns {Object} Returns `object`.
21  * @see _.defaultsDeep
22  * @example
23  *
24  * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
25  * // => { 'a': 1, 'b': 2 }
26  */
27 var defaults = baseRest(function(args) {
28   args.push(undefined, customDefaultsAssignIn);
29   return apply(assignInWith, undefined, args);
30 });
31
32 module.exports = defaults;