liudong
2023-05-29 340f156319b863525e50e900c58e59b86ecb3d5e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
define(['./isArray', './isObject', './_set'], function (isArray, isObject, _set) {
 
  // 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;
  }
 
  return set;
 
});