File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ export function isSyncFunction(
473473 */
474474export function isAsyncFunction (
475475 x : unknown ,
476- ) : x is ( ...args : unknown [ ] ) => unknown {
476+ ) : x is ( ...args : unknown [ ] ) => Promise < unknown > {
477477 return Object . prototype . toString . call ( x ) === "[object AsyncFunction]" ;
478478}
479479
Original file line number Diff line number Diff line change @@ -759,18 +759,33 @@ Deno.test("isFunction", async (t) => {
759759 await testWithExamples ( t , isFunction , {
760760 validExamples : [ "syncFunction" , "asyncFunction" ] ,
761761 } ) ;
762+ type _ = AssertTrue <
763+ IsExact < PredicateType < typeof isFunction > , ( ...args : unknown [ ] ) => unknown >
764+ > ;
762765} ) ;
763766
764767Deno . test ( "isSyncFunction" , async ( t ) => {
765768 await testWithExamples ( t , isSyncFunction , {
766769 validExamples : [ "syncFunction" ] ,
767770 } ) ;
771+ type _ = AssertTrue <
772+ IsExact <
773+ PredicateType < typeof isSyncFunction > ,
774+ ( ...args : unknown [ ] ) => unknown
775+ >
776+ > ;
768777} ) ;
769778
770779Deno . test ( "isAsyncFunction" , async ( t ) => {
771780 await testWithExamples ( t , isAsyncFunction , {
772781 validExamples : [ "asyncFunction" ] ,
773782 } ) ;
783+ type _ = AssertTrue <
784+ IsExact <
785+ PredicateType < typeof isAsyncFunction > ,
786+ ( ...args : unknown [ ] ) => Promise < unknown >
787+ >
788+ > ;
774789} ) ;
775790
776791Deno . test ( "isInstanceOf<T>" , async ( t ) => {
You can’t perform that action at this time.
0 commit comments