From 6697d29430ac9ce5f55572a2d7762baa1f05a33b Mon Sep 17 00:00:00 2001 From: tunnckoCore Date: Thu, 25 Jun 2015 02:24:12 +0300 Subject: [PATCH] check also for `done` and `next` --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b3fa542..0a68291 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,7 @@ module.exports = function isAsyncFn (fn, max) { throw new TypeError('is-async-function expect a function') } - var fnStr = fn.toString().slice(8, Number(max) || 150) - return fnStr.indexOf('callback') !== -1 || fnStr.indexOf('cb') !== -1 + var fnStr = fn.toString().slice(8, Number(max) || 100) + return fnStr.indexOf('callback') !== -1 || fnStr.indexOf('cb') !== -1 || + fnStr.indexOf('done') !== -1 || fnStr.indexOf('next') !== -1 }