Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

props should be typed #23

Open
ShravanSunder opened this issue Apr 21, 2023 · 0 comments
Open

props should be typed #23

ShravanSunder opened this issue Apr 21, 2023 · 0 comments

Comments

@ShravanSunder
Copy link

ShravanSunder commented Apr 21, 2023

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant