diff --git a/lib/utils.js b/lib/utils.js index 6beea04..ccf31b1 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -662,11 +662,7 @@ const toJSONObject = (obj) => { return visit(obj, 0); } -const [isPlainFunction, isAsyncFn, isGeneratorFn, isAsyncGeneratorFn] = ( - (...fns) => fns.map( - ({constructor})=> (thing) => thing && typeof thing === 'function' && thing.constructor === constructor - ) -)(()=> {}, async()=>{}, function*(){}, async function*(){}); +const isAsyncFn = kindOfTest('AsyncFunction'); const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); @@ -722,8 +718,5 @@ export default { isSpecCompliantForm, toJSONObject, isAsyncFn, - isGeneratorFn, - isAsyncGeneratorFn, - isPlainFunction, isThenable };