(importIdentifiers)
| 85 | }) |
| 86 | |
| 87 | const findQueryClientIdentifiers = (importIdentifiers) => |
| 88 | root |
| 89 | .find(jscodeshift.VariableDeclarator, {}) |
| 90 | .filter((node) => { |
| 91 | if (node.value.init) { |
| 92 | const initializer = node.value.init |
| 93 | |
| 94 | return ( |
| 95 | isClassInstantiationOf( |
| 96 | initializer, |
| 97 | getSelectorByImports(importIdentifiers, 'QueryClient'), |
| 98 | ) || |
| 99 | isFunctionCallOf( |
| 100 | initializer, |
| 101 | getSelectorByImports(importIdentifiers, 'useQueryClient'), |
| 102 | ) |
| 103 | ) |
| 104 | } |
| 105 | |
| 106 | return false |
| 107 | }) |
| 108 | .paths() |
| 109 | .map((node) => node.value.id.name) |
| 110 | |
| 111 | const isCallExpression = (node) => |
| 112 | jscodeshift.match(node, { type: jscodeshift.CallExpression.name }) |
nothing calls this directly
no test coverage detected
searching dependent graphs…