@rustable/utils
Version:
Essential utilities for object cloning, string manipulation, and value comparison in TypeScript, inspired by Rust's standard library.
9 lines (8 loc) • 373 B
TypeScript
/**
* Deep copy function that handles various data types and circular references
* @param data The data to be cloned
* @param inClone Flag to indicate if the function is being called recursively
* @param hash WeakMap to track circular references
* @returns Deep copy of the input data
*/
export declare function deepClone<T>(data: T, hash?: WeakMap<object, any>): T;