From 72088cb2178ea2a0f3f38a664784dd2c69b509d4 Mon Sep 17 00:00:00 2001 From: Palm Date: Fri, 20 Sep 2024 04:12:21 +0700 Subject: [PATCH] fix: apply review changes - Correct type for `before` hooks - Change cleanup functions type to `Function[]` --- src/shared.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared.ts b/src/shared.ts index bf4fb58..78e640b 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -2,7 +2,7 @@ export type PatchType = "a" | "b" | "i"; export type PatchTypeToCallbackMap = { a: (args: Parameters, ret: ReturnType) => ReturnType; - b: (args: Parameters) => ReturnType; + b: (args: Parameters) => Parameters | void | undefined; i: (args: Parameters, origFunc: F) => ReturnType; } @@ -17,7 +17,7 @@ export type Patch = { // WeakRef to parent object p: WeakRef; // cleanups - c: AnyFunction[]; + c: Function[]; // after hooks a: Map; // before hooks