mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Add _.setWith tests.
This commit is contained in:
@@ -9453,12 +9453,12 @@
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* _.setWith({ '0': {} }, '[0][1][2]', 3, function(value) {
|
||||
* _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, function(value) {
|
||||
* if (!_.isObject(value)) {
|
||||
* return {};
|
||||
* }
|
||||
* });
|
||||
* // => { '0': { '1': { '2': 3 } } }
|
||||
* // => { '0': { '1': { '2': 3 }, 'length': 2 } }
|
||||
*/
|
||||
function setWith(object, path, value, customizer) {
|
||||
customizer = typeof customizer == 'function' ? customizer : undefined;
|
||||
|
||||
Reference in New Issue
Block a user