Skip to content

Commit

Permalink
chore: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Sep 8, 2023
1 parent 4c7c9f0 commit fa612c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helper/hook-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export function createHookedFunction<ThisType, Args extends any[], Result>(
});
}

function wrapped(): Result {
function wrapped(): Result | void | Promise<Result | void> {
promise = runBeforeHooks();

if (promise) {
Expand All @@ -330,9 +330,9 @@ export function createHookedFunction<ThisType, Args extends any[], Result>(
if (promise) {
return promise.then(() => {
return ret;
}) as any; // 挂载了async hook方法
});
} else {
return ret as any;
return ret;
}
}
};
Expand Down

0 comments on commit fa612c4

Please sign in to comment.