Riku
2024-08-13 093afd3be27ea5e9692839845b69bd56e2405518
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 };