Skip to content

Commit

Permalink
fix: fix the "isFunction" utility to match both "asyncFunction"s and …
Browse files Browse the repository at this point in the history
…"Function"s (#927)

current behavior is the utility tries to match only "Function" and therefore "AsyncFunction" will be
considered bad and error will be thrown

fix #926
  • Loading branch information
tal-rofe authored Apr 25, 2022
1 parent fc283fb commit 25dc80c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ function isFunction (functionToCheck) {
return false;
} else {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
var functionType = getType.toString.call(functionToCheck);
return functionToCheck && (functionType === '[object Function]' || functionType === '[object AsyncFunction]');
}
}

Expand Down

0 comments on commit 25dc80c

Please sign in to comment.