home
This commit is contained in:
parent
a71a3b5593
commit
cb52890889
16657 changed files with 1483086 additions and 1 deletions
14
home/ags/node_modules/eslint-plugin-promise/rules/lib/is-named-callback.js
generated
vendored
Normal file
14
home/ags/node_modules/eslint-plugin-promise/rules/lib/is-named-callback.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
'use strict'
|
||||
|
||||
let callbacks = ['done', 'cb', 'callback', 'next']
|
||||
|
||||
module.exports = function isNamedCallback(potentialCallbackName, exceptions) {
|
||||
for (let i = 0; i < exceptions.length; i++) {
|
||||
callbacks = callbacks.filter((item) => {
|
||||
return item !== exceptions[i]
|
||||
})
|
||||
}
|
||||
return callbacks.some((trueCallbackName) => {
|
||||
return potentialCallbackName === trueCallbackName
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue