Skip to content

Commit 25dc80c

Browse files
authored
fix: fix the "isFunction" utility to match both "asyncFunction"s and "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
1 parent fc283fb commit 25dc80c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/util.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function isFunction (functionToCheck) {
3838
return false;
3939
} else {
4040
var getType = {};
41-
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
41+
var functionType = getType.toString.call(functionToCheck);
42+
return functionToCheck && (functionType === '[object Function]' || functionType === '[object AsyncFunction]');
4243
}
4344
}
4445

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy