copy-anything
copy-anything copied to clipboard
props should be typed
props should be typed to keyof T, we will get type safety this way
export type Options<T> = {
props?: (keyof T)[];
nonenumerable?: boolean;
};
/**
* Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.
*
* @param target Target can be anything
* @param [options = {}] Options can be `props` or `nonenumerable`
* @returns the target with replaced values
*/
export declare function copy<T>(target: T, options?: Options<T>): T;