riku
2024-07-26 1a4d35a08d05e014663c144771976abb0edaa933
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 };