(path)
| 161 | }, |
| 162 | |
| 163 | VariableDeclaration(path) { |
| 164 | if (!FileWithImports) return |
| 165 | |
| 166 | for (const decl of path.node.declarations) { |
| 167 | |
| 168 | // Check initializer is a call to createSignal/createMemo/createStore/createMutable |
| 169 | if (!decl.init || decl.init.type !== 'CallExpression') continue |
| 170 | |
| 171 | const target = getTarget(decl.init.callee, Sources, SOURCE_TYPES.returning) |
| 172 | if (!target) continue |
| 173 | |
| 174 | let name: string |
| 175 | |
| 176 | // Check declaration is either identifier or [identifier, ...] |
| 177 | if (decl.id.type === 'Identifier') { |
| 178 | name = decl.id.name |
| 179 | } |
| 180 | else if (decl.id.type === 'ArrayPattern' && decl.id.elements[0]?.type === 'Identifier') { |
| 181 | name = decl.id.elements[0].name |
| 182 | } |
| 183 | else { |
| 184 | continue |
| 185 | } |
| 186 | |
| 187 | addNameToOptions(decl.init, OPTIONS_ARG_POS[target], name) |
| 188 | } |
| 189 | }, |
| 190 | |
| 191 | CallExpression(path) { |
| 192 | if (!FileWithImports) return |
nothing calls this directly
no test coverage detected
searching dependent graphs…