Skip to content

Commit

Permalink
check also for done and next
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Jun 24, 2015
1 parent 66eab5f commit 6697d29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 6697d29

Please sign in to comment.