'use strict';varfnToStr=Function.prototype.toString;varconstructorRegex=/^\s*class\b/;varisES6ClassFn=functionisES6ClassFunction(value){try{varfnStr=fnToStr.call(value);returnconstructorRegex.test(fnStr);}catch(e){returnfalse;// not a function}};vartryFunctionObject=functiontryFunctionToStr(value){try{if(isES6ClassFn(value)){returnfalse;}fnToStr.call(value);returntrue;}catch(e){returnfalse;}};vartoStr=Object.prototype.toString;varfnClass='[object Function]';vargenClass='[object GeneratorFunction]';varhasToStringTag=typeofSymbol==='function'&&typeofSymbol.toStringTag==='symbol';module.exports=functionisCallable(value){if(!value){returnfalse;}if(typeofvalue!=='function'&&typeofvalue!=='object'){returnfalse;}if(typeofvalue==='function'&&!value.prototype){returntrue;}if(hasToStringTag){returntryFunctionObject(value);}if(isES6ClassFn(value)){returnfalse;}varstrClass=toStr.call(value);returnstrClass===fnClass||strClass===genClass;};