basant307/AI_Governance_Project
045
1var baseSet = require('./_baseSet');2 3/**4 * This method is like `_.set` except that it accepts `customizer` which is5 * invoked to produce the objects of `path`. If `customizer` returns `undefined`6 * path creation is handled by the method instead. The `customizer` is invoked7 * with three arguments: (nsValue, key, nsObject).8 *9 * **Note:** This method mutates `object`.10 *11 * @static12 * @memberOf _13 * @since 4.0.014 * @category Object15 * @param {Object} object The object to modify.16 * @param {Array|string} path The path of the property to set.17 * @param {*} value The value to set.18 * @param {Function} [customizer] The function to customize assigned values.19 * @returns {Object} Returns `object`.20 * @example21 *22 * var object = {};23 *24 * _.setWith(object, '[0][1]', 'a', Object);25 * // => { '0': { '1': 'a' } }26 */27function setWith(object, path, value, customizer) {28 customizer = typeof customizer == 'function' ? customizer : undefined;29 return object == null ? object : baseSet(object, path, value, customizer);30}31 32module.exports = setWith;33 