Skip to content

Commit

Permalink
use common-callback-names
Browse files Browse the repository at this point in the history
  • Loading branch information
tunnckoCore committed Apr 21, 2016
1 parent 0e8dad7 commit 37c253f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 2 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ module.exports = function isAsyncFunction (fn, names) {
if (typeof fn !== 'function') {
throw new TypeError('is-async-function expect a function')
}

var defaults = ['callback', 'callback_', 'done', 'next', 'cb']
var args = require('function-arguments')(fn)

names = require('isarray')(names) ? names : defaults
return require('arr-includes')(args, names)
names = require('isarray')(names) ? names : require('common-callback-names')
return require('arr-includes')(require('function-arguments')(fn), names)
}

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"arr-includes": "^1.0.0",
"common-callback-names": "^1.0.2",
"function-arguments": "^1.0.1",
"isarray": "^1.0.0"
},
Expand Down Expand Up @@ -73,4 +74,4 @@
"reflinks": true
}
}
}
}

0 comments on commit 37c253f

Please sign in to comment.