main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
837 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import apply from './_apply.js';
|
---|
| 2 | import baseRest from './_baseRest.js';
|
---|
| 3 | import customDefaultsMerge from './_customDefaultsMerge.js';
|
---|
| 4 | import mergeWith from './mergeWith.js';
|
---|
| 5 |
|
---|
| 6 | /**
|
---|
| 7 | * This method is like `_.defaults` except that it recursively assigns
|
---|
| 8 | * default properties.
|
---|
| 9 | *
|
---|
| 10 | * **Note:** This method mutates `object`.
|
---|
| 11 | *
|
---|
| 12 | * @static
|
---|
| 13 | * @memberOf _
|
---|
| 14 | * @since 3.10.0
|
---|
| 15 | * @category Object
|
---|
| 16 | * @param {Object} object The destination object.
|
---|
| 17 | * @param {...Object} [sources] The source objects.
|
---|
| 18 | * @returns {Object} Returns `object`.
|
---|
| 19 | * @see _.defaults
|
---|
| 20 | * @example
|
---|
| 21 | *
|
---|
| 22 | * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
|
---|
| 23 | * // => { 'a': { 'b': 2, 'c': 3 } }
|
---|
| 24 | */
|
---|
| 25 | var defaultsDeep = baseRest(function(args) {
|
---|
| 26 | args.push(undefined, customDefaultsMerge);
|
---|
| 27 | return apply(mergeWith, undefined, args);
|
---|
| 28 | });
|
---|
| 29 |
|
---|
| 30 | export default defaultsDeep;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.