This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Deep copy function for TypeScript. | |
* @param T Generic type of target/copied value. | |
* @param target Target value to be copied. | |
* @see Source project, ts-deepcopy https://github.com/ykdr2017/ts-deepcopy | |
* @see Code pen https://codepen.io/erikvullings/pen/ejyBYg | |
*/ | |
export const deepCopy = <T>(target: T): T => { | |
if (target === null) { | |
return target; |