Sha256: b83890de705968c5e21bd6bdd0d8e6b23135401c0b27c41ad9c876f79de2aa05

Contents?: true

Size: 1.67 KB

Versions: 153

Compression:

Stored size: 1.67 KB

Contents

var baseMerge = require('../internal/baseMerge'),
    createAssigner = require('../internal/createAssigner');

/**
 * Recursively merges own enumerable properties of the source object(s), that
 * don't resolve to `undefined` into the destination object. Subsequent sources
 * overwrite property assignments of previous sources. If `customizer` is
 * provided it's invoked to produce the merged values of the destination and
 * source properties. If `customizer` returns `undefined` merging is handled
 * by the method instead. The `customizer` is bound to `thisArg` and invoked
 * with five arguments: (objectValue, sourceValue, key, object, source).
 *
 * @static
 * @memberOf _
 * @category Object
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @param {Function} [customizer] The function to customize assigned values.
 * @param {*} [thisArg] The `this` binding of `customizer`.
 * @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 }] }
 *
 * // using a customizer callback
 * var object = {
 *   'fruits': ['apple'],
 *   'vegetables': ['beet']
 * };
 *
 * var other = {
 *   'fruits': ['banana'],
 *   'vegetables': ['carrot']
 * };
 *
 * _.merge(object, other, function(a, b) {
 *   if (_.isArray(a)) {
 *     return a.concat(b);
 *   }
 * });
 * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
 */
var merge = createAssigner(baseMerge);

module.exports = merge;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
trusty-festivity-extension-2.3.30 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/inquirer/node_modules/lodash/object/merge.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/merge.js
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/lodash/object/merge.js
es6_tilt-0.1.2 test/dummy/node_modules/lodash/object/merge.js
es6_tilt-0.1.1 test/dummy/node_modules/lodash/object/merge.js
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/lodash/object/merge.js
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/lodash/object/merge.js