mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Add to docs of _.assignWith and _.setWith. [ci skip]
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -8498,7 +8498,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.assign` except that it accepts `customizer` which
|
* This method is like `_.assign` except that it accepts `customizer` which
|
||||||
* is invoked to produce the assigned values. The `customizer` is invoked
|
* is invoked to produce the assigned values. If `customizer` returns `undefined`
|
||||||
|
* assignment is handled by the method instead. The `customizer` is invoked
|
||||||
* with five arguments: (objectValue, sourceValue, key, object, source).
|
* with five arguments: (objectValue, sourceValue, key, object, source).
|
||||||
*
|
*
|
||||||
* **Note:** This method mutates `object`.
|
* **Note:** This method mutates `object`.
|
||||||
@@ -9418,8 +9419,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.set` except that it accepts `customizer` which
|
* This method is like `_.set` except that it accepts `customizer` which
|
||||||
* is invoked to produce the namespace objects of `path`. The `customizer`
|
* is invoked to produce the namespace objects of `path`. If `customizer`
|
||||||
* is invoked with three arguments: (nsValue, key, nsObject).
|
* returns `undefined` namespace creation is handled by the method instead.
|
||||||
|
* The `customizer` is invoked with three arguments: (nsValue, key, nsObject).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -9431,7 +9433,9 @@
|
|||||||
* @returns {Object} Returns `object`.
|
* @returns {Object} Returns `object`.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.setWith({}, '[0][1][2]', 3, Object);
|
* _.setWith({ '0': {} }, '[0][1][2]', 3, function(value) {
|
||||||
|
* return _.isObject(value) ? value : {};
|
||||||
|
* });
|
||||||
* // => { '0': { '1': { '2': 3 } } }
|
* // => { '0': { '1': { '2': 3 } } }
|
||||||
*/
|
*/
|
||||||
function setWith(object, path, value, customizer) {
|
function setWith(object, path, value, customizer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user