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

Method getModuleImportsIntoDeclarationFiles

src/db/queries.ts:4034–4052  ·  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

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

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