同步
This commit is contained in:
		@@ -276,7 +276,14 @@ export function deepClone(source) {
 | 
				
			|||||||
  if (!source && typeof source !== 'object') {
 | 
					  if (!source && typeof source !== 'object') {
 | 
				
			||||||
    throw new Error('error arguments', 'shallowClone')
 | 
					    throw new Error('error arguments', 'shallowClone')
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  const targetObj = source.constructor === Array ? Object.assign([], source) : Object.assign({}, source)
 | 
					  const targetObj = source.constructor === Array ? [] : {}
 | 
				
			||||||
 | 
					  Object.keys(source).forEach(keys => {
 | 
				
			||||||
 | 
					    if (source[keys] && typeof source[keys] === 'object') {
 | 
				
			||||||
 | 
					      targetObj[keys] = deepClone(source[keys])
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      targetObj[keys] = source[keys]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
  return targetObj
 | 
					  return targetObj
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user