MCPcopy
hub / github.com/commitizen/cz-cli / isFunction

Function isFunction

src/common/util.js:33–44  ·  view source on GitHub ↗

* Test if the passed argument is a function

(functionToCheck)

Source from the content-addressed store, hash-verified

31 * Test if the passed argument is a function
32 */
33function isFunction (functionToCheck) {
34 if (typeof functionToCheck === "undefined")
35 {
36 return false;
37 } else if (functionToCheck === null) {
38 return false;
39 } else {
40 var getType = {};
41 var functionType = getType.toString.call(functionToCheck);
42 return functionToCheck && (functionType === '[object Function]' || functionType === '[object AsyncFunction]');
43 }
44}
45
46function isInTest () {
47 return typeof global.it === 'function';

Callers 3

util.jsFile · 0.90
adapter.jsFile · 0.90
getPrompterFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected