(node, drizzleObjectName)
| 19 | } |
| 20 | |
| 21 | function isDrizzleObj(node, drizzleObjectName) { |
| 22 | // Check the object the method is called on (e.g. db in db.delete, ctx.db in ctx.db.delete) |
| 23 | const objectPath = resolveMemberPath(node.object); |
| 24 | if (objectPath && isDrizzleObjName(objectPath, drizzleObjectName)) { |
| 25 | return true; |
| 26 | } |
| 27 | // Also check the callee for patterns like getDb().delete(...) |
| 28 | if (node.object.type === 'CallExpression') { |
| 29 | const calleePath = resolveMemberPath(node.object.callee); |
| 30 | if (calleePath && isDrizzleObjName(calleePath, drizzleObjectName)) { |
| 31 | return true; |
| 32 | } |
| 33 | } |
| 34 | return false; |
| 35 | } |
| 36 | |
| 37 | function hasWhereInChain(node) { |
| 38 | let current = node.parent; |
no test coverage detected