diff options
Diffstat (limited to 'tools/eslint/node_modules/lodash/merge.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/merge.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/lodash/merge.js b/tools/eslint/node_modules/lodash/merge.js new file mode 100644 index 0000000000..07625956a6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/merge.js @@ -0,0 +1,37 @@ +var baseMerge = require('./_baseMerge'), + createAssigner = require('./_createAssigner'); + +/** + * Recursively merges own and inherited enumerable properties of source + * objects into the destination object, skipping source properties that resolve + * to `undefined`. Array and plain object properties are merged recursively. + * Other objects and value types are overridden by assignment. Source objects + * are applied from left to right. Subsequent sources overwrite property + * assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); + +module.exports = merge; |