MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getModuleImportsIntoDeclarationFiles

Method getModuleImportsIntoDeclarationFiles

src/db/queries.ts:3923–3941  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

3921 * import of a package lands while a `declare module` of it is all there is.
3922 */
3923 getModuleImportsIntoDeclarationFiles(): Array<Edge & { edgeId: number; targetFilePath: string; sourceFilePath: string; sourceLanguage: Language }> {
3924 const rows = this.db
3925 .prepare(
3926 `SELECT e.*, tgt.file_path AS target_file_path, src.file_path AS source_file_path, src.language AS source_language
3927 FROM nodes tgt
3928 JOIN edges e ON e.target = tgt.id AND e.kind = 'imports'
3929 JOIN nodes src ON src.id = e.source
3930 WHERE tgt.kind = 'file'
3931 AND (tgt.file_path LIKE '%.d.ts' OR tgt.file_path LIKE '%.d.mts' OR tgt.file_path LIKE '%.d.cts')`
3932 )
3933 .all() as Array<EdgeRow & { target_file_path: string; source_file_path: string; source_language: Language }>;
3934 return rows.map((row) => ({
3935 ...rowToEdge(row),
3936 edgeId: row.id,
3937 targetFilePath: row.target_file_path,
3938 sourceFilePath: row.source_file_path,
3939 sourceLanguage: row.source_language,
3940 }));
3941 }
3942
3943 /**
3944 * The module edges (`imports` edges into a file node) into the files an

Callers 1

outrankedImportsFunction · 0.80

Calls 4

rowToEdgeFunction · 0.85
mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected