Skip to content
New issue

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

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

Already on GitHub? # to your account

Typing: add cloneProtoObject option to Options interface #69

Merged
merged 3 commits into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,17 @@ type MergeArrayFnOptions = {
getKeys: (value: object) => string[];
}

/**
* A function responsible handling the cloning logic of the provided prototype object.
*
* @param value - The proto object to clone.
* @returns the resulting clone (can also return the object itself if you do not want clone but replace).
*/
type CloneProtoObjectFn = (value: any) => any
type MergeArrayFn = (options: MergeArrayFnOptions) => (target: any[], source: any[]) => any[]

interface Options {
cloneProtoObject?: CloneProtoObjectFn;
mergeArray?: MergeArrayFn;
symbols?: boolean;
all?: boolean;
Expand Down