mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 10:49:00 +00:00 
			
		
		
		
	
		
			
	
	
		
			11 lines
		
	
	
		
			322 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			11 lines
		
	
	
		
			322 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|   | /** | ||
|  |  * Deep clones a reference value provided. If the value is primitive, i.e. not immutable deepClone is an | ||
|  |  * identity function | ||
|  |  * @template T | ||
|  |  * @param {T} value | ||
|  |  * @return {T} | ||
|  |  */ | ||
|  | const deepClone = <T>(value: T): T => (typeof value === 'object' ? JSON.parse(JSON.stringify(value)) : value); | ||
|  | 
 | ||
|  | export default deepClone; |