| 9 | } |
| 10 | |
| 11 | function resolveMemberPath(node) { |
| 12 | if (node.type === 'Identifier') return node.name; |
| 13 | if (node.type === 'MemberExpression' && node.property.type === 'Identifier') { |
| 14 | const objectPath = resolveMemberPath(node.object); |
| 15 | return objectPath ? `${objectPath}.${node.property.name}` : null; |
| 16 | } |
| 17 | if (node.type === 'ThisExpression') return 'this'; |
| 18 | return null; |
| 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) |