All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
16 lines
335 B
JavaScript
16 lines
335 B
JavaScript
var isArray = require('./isArray.js');
|
|
var isObject = require('./isObject.js');
|
|
var _set = require('./_set.js');
|
|
|
|
// set the value in given path
|
|
function set (obj, path, value) {
|
|
if (!isObject(obj) || !isArray(path)) return obj;
|
|
if (path.length === 0) return obj;
|
|
|
|
_set(obj, path, value);
|
|
|
|
return obj;
|
|
}
|
|
|
|
module.exports = set;
|