* The module edges (`imports` edges into a file node) into declaration * files, with the source file and language a resurrection needs: where an * import of a package lands while a `declare module` of it is all there is.
()
| 4032 | * import of a package lands while a `declare module` of it is all there is. |
| 4033 | */ |
| 4034 | getModuleImportsIntoDeclarationFiles(): Array<Edge & { edgeId: number; targetFilePath: string; sourceFilePath: string; sourceLanguage: Language }> { |
| 4035 | const rows = this.db |
| 4036 | .prepare( |
| 4037 | `SELECT e.*, tgt.file_path AS target_file_path, src.file_path AS source_file_path, src.language AS source_language |
| 4038 | FROM nodes tgt |
| 4039 | JOIN edges e ON e.target = tgt.id AND e.kind = 'imports' |
| 4040 | JOIN nodes src ON src.id = e.source |
| 4041 | WHERE tgt.kind = 'file' |
| 4042 | AND (tgt.file_path LIKE '%.d.ts' OR tgt.file_path LIKE '%.d.mts' OR tgt.file_path LIKE '%.d.cts')` |
| 4043 | ) |
| 4044 | .all() as Array<EdgeRow & { target_file_path: string; source_file_path: string; source_language: Language }>; |
| 4045 | return rows.map((row) => ({ |
| 4046 | ...rowToEdge(row), |
| 4047 | edgeId: row.id, |
| 4048 | targetFilePath: row.target_file_path, |
| 4049 | sourceFilePath: row.source_file_path, |
| 4050 | sourceLanguage: row.source_language, |
| 4051 | })); |
| 4052 | } |
| 4053 | |
| 4054 | /** |
| 4055 | * The module edges (`imports` edges into a file node) into the files an |
no test coverage detected