UNPKG

603 BJavaScriptView Raw
1import baseGet from './_baseGet.js';
2import baseSet from './_baseSet.js';
3
4/**
5 * The base implementation of `_.update`.
6 *
7 * @private
8 * @param {Object} object The object to modify.
9 * @param {Array|string} path The path of the property to update.
10 * @param {Function} updater The function to produce the updated value.
11 * @param {Function} [customizer] The function to customize path creation.
12 * @returns {Object} Returns `object`.
13 */
14function baseUpdate(object, path, updater, customizer) {
15 return baseSet(object, path, updater(baseGet(object, path)), customizer);
16}
17
18export default baseUpdate;