Skip to content

Commit

Permalink
fix: remove useless check of async methods
Browse files Browse the repository at this point in the history
  • Loading branch information
boredland committed Oct 3, 2022
1 parent 81f1377 commit 5ed0389
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/core/src/decorator/cache-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,7 @@ export function Cache(

const runOriginalMethod = async () => {
const methodCall = originalMethod.apply(this, args)

const isAsync =
methodCall?.constructor?.name === "AsyncFunction" ||
methodCall?.constructor?.name === "Promise"

if (isAsync) {
return await methodCall
} else {
return methodCall
}
return await methodCall
}

if (!target.__node_ts_cache_method_run_queue) {
Expand Down

0 comments on commit 5ed0389

Please sign in to comment.