Removed modules/contrib/media module to allow update to the core media module
[yaffs-website] / node_modules / uncss / node_modules / lodash / setWith.js
1 var baseSet = require('./internal/baseSet');
2
3 /**
4  * This method is like `_.set` except that it accepts `customizer` which is
5  * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
6  * path creation is handled by the method instead. The `customizer` is invoked
7  * with three arguments: (nsValue, key, nsObject).
8  *
9  * @static
10  * @memberOf _
11  * @category Object
12  * @param {Object} object The object to modify.
13  * @param {Array|string} path The path of the property to set.
14  * @param {*} value The value to set.
15  * @param {Function} [customizer] The function to customize assigned values.
16  * @returns {Object} Returns `object`.
17  * @example
18  *
19  * _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);
20  * // => { '0': { '1': { '2': 3 }, 'length': 2 } }
21  */
22 function setWith(object, path, value, customizer) {
23   customizer = typeof customizer == 'function' ? customizer : undefined;
24   return object == null ? object : baseSet(object, path, value, customizer);
25 }
26
27 module.exports = setWith;