Server : Apache System : Linux ks5.tuic.fr 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 User : pragmatice ( 1003) PHP Version : 8.2.24 Disable Function : NONE Directory : /home/etherpad/node_modules/eslint-plugin-promise/rules/lib/ |
'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