Skip to content

Commit

Permalink
fix: apply review changes
Browse files Browse the repository at this point in the history
- Correct type for `before` hooks
- Change cleanup functions type to `Function[]`
  • Loading branch information
PalmDevs authored Sep 19, 2024
1 parent d04fb37 commit 72088cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type PatchType = "a" | "b" | "i";

export type PatchTypeToCallbackMap<F extends AnyFunction> = {
a: (args: Parameters<F>, ret: ReturnType<F>) => ReturnType<F>;
b: (args: Parameters<F>) => ReturnType<F>;
b: (args: Parameters<F>) => Parameters<F> | void | undefined;
i: (args: Parameters<F>, origFunc: F) => ReturnType<F>;
}

Expand All @@ -17,7 +17,7 @@ export type Patch = {
// WeakRef to parent object
p: WeakRef<any>;
// cleanups
c: AnyFunction[];
c: Function[];
// after hooks
a: Map<symbol, AnyFunction>;
// before hooks
Expand Down

0 comments on commit 72088cb

Please sign in to comment.