Skip to content

Commit

Permalink
fix(typescript): fixed compiling on TS 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
grantila committed Jan 11, 2023
1 parent cc435de commit c7f6a04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1318,10 +1318,14 @@ export function wrapFunction< T, R extends Promise< void > | void >(
}

if (
cbRet && typeof ( < Promise< U > >cbRet ).then === "function"
cbRet &&
typeof ( cbRet as Promise< U > | U as Promise< U > ).then
=== "function"
)
{
return < Promise< U > >( < Promise< U > >cbRet )
return < Promise< U > >(
cbRet as Promise< U > | U as Promise< U >
)
.finally( ( ) => callCleanup( cleanup ) );
}
else
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"trace-unhandled": "^2.0.1",
"ts-jest": "^26.4.4",
"tslint": "6.1.3",
"typescript": "4.5.4"
"typescript": "4.9.4"
},
"config": {
"commitizen": {
Expand Down

0 comments on commit c7f6a04

Please sign in to comment.