Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
16 lines
470 B
Plaintext
16 lines
470 B
Plaintext
'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
|