Sha256: 686f7e67fc02344b760b85528ac13d7e85ac93fc700a9fc786b98c37002f0b20

Contents?: true

Size: 1.16 KB

Versions: 303

Compression:

Stored size: 1.16 KB

Contents

var baseUpdate = require('./_baseUpdate'),
    castFunction = require('./_castFunction');

/**
 * This method is like `_.update` except that it accepts `customizer` which is
 * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
 * path creation is handled by the method instead. The `customizer` is invoked
 * with three arguments: (nsValue, key, nsObject).
 *
 * **Note:** This method mutates `object`.
 *
 * @static
 * @memberOf _
 * @since 4.6.0
 * @category Object
 * @param {Object} object The object to modify.
 * @param {Array|string} path The path of the property to set.
 * @param {Function} updater The function to produce the updated value.
 * @param {Function} [customizer] The function to customize assigned values.
 * @returns {Object} Returns `object`.
 * @example
 *
 * var object = {};
 *
 * _.updateWith(object, '[0][1]', _.constant('a'), Object);
 * // => { '0': { '1': 'a' } }
 */
function updateWith(object, path, updater, customizer) {
  customizer = typeof customizer == 'function' ? customizer : undefined;
  return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
}

module.exports = updateWith;

Version data entries

303 entries across 279 versions & 33 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/updateWith.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/updateWith.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.60 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.59 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.58 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.57 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.56 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.55 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.54 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.53 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.52 node_modules/lodash/updateWith.js
trusty-cms-6.3.1 node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.51 node_modules/lodash/updateWith.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/updateWith.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/updateWith.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/updateWith.js
immosquare-cleaner-0.1.50 node_modules/lodash/updateWith.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/updateWith.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/updateWith.js