refactor start
This commit is contained in:
parent
bd49791e06
commit
e46d25f0b7
16699 changed files with 2 additions and 1484887 deletions
15
home/ags/node_modules/eslint-plugin-promise/rules/lib/is-inside-promise.js
generated
vendored
15
home/ags/node_modules/eslint-plugin-promise/rules/lib/is-inside-promise.js
generated
vendored
|
|
@ -1,15 +0,0 @@
|
|||
'use strict'
|
||||
|
||||
function isInsidePromise(node) {
|
||||
const isFunctionExpression =
|
||||
node.type === 'FunctionExpression' ||
|
||||
node.type === 'ArrowFunctionExpression'
|
||||
const parent = node.parent || {}
|
||||
const callee = parent.callee || {}
|
||||
const name = (callee.property && callee.property.name) || ''
|
||||
const parentIsPromise = name === 'then' || name === 'catch'
|
||||
const isInCB = isFunctionExpression && parentIsPromise
|
||||
return isInCB
|
||||
}
|
||||
|
||||
module.exports = isInsidePromise
|
||||
Loading…
Add table
Add a link
Reference in a new issue