riku
2024-08-12 65124213af664a68ad88ce7f6dcb133116d7702f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 深度拷贝
function deepCopy(obj) {
  let b1 = typeof obj;
  if (b1 != 'object' || obj instanceof Array || obj == null) {
    return obj;
  }
  var newobj = {};
  for (var attr in obj) {
    newobj[attr] = this.deepCopy(obj[attr]);
  }
  return newobj;
}
 
export { deepCopy };