(path)
| 130 | |
| 131 | // Track imported references to sources |
| 132 | ImportDeclaration(path) { |
| 133 | |
| 134 | const source = path.node.source.value |
| 135 | const targets = SOURCE_MODULES[source] |
| 136 | if (!targets) return |
| 137 | |
| 138 | for (const s of path.node.specifiers) { |
| 139 | // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check |
| 140 | switch (s.type) { |
| 141 | // import * as local from "solid-js" |
| 142 | case 'ImportNamespaceSpecifier': |
| 143 | for (const target of targets) { |
| 144 | Sources[target].push(t.memberExpression(s.local, t.identifier(target))) |
| 145 | FileWithImports = true |
| 146 | } |
| 147 | break |
| 148 | // import { createSignal } from "solid-js" |
| 149 | // import { createSignal as local } from "solid-js" |
| 150 | // import { "createSignal" as local } from "solid-js" |
| 151 | case 'ImportSpecifier': { |
| 152 | const name = s.imported.type === 'Identifier' ? s.imported.name : s.imported.value |
| 153 | if (targets.has(name)) { |
| 154 | Sources[name as Source].push(s.local) |
| 155 | FileWithImports = true |
| 156 | } |
| 157 | break |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | }, |
| 162 | |
| 163 | VariableDeclaration(path) { |
| 164 | if (!FileWithImports) return |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…