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

Method getReExportStatementsByFiles

src/db/queries.ts:5762–5775  ·  view source on GitHub ↗

* The `file\0statement` pairs of the `export … from` statements in * `filePaths` (#2978). Each is an import node named by the module it names, * with the statement as its signature, so a re-export pointed at another * module, taken away, added, or passing other names on changes a pair, and

(filePaths: string[])

Source from the content-addressed store, hash-verified

5760 * plain `import` does not. Same shape as {@link getNodeNamePairsByFiles}.
5761 */
5762 getReExportStatementsByFiles(filePaths: string[]): Set<string> {
5763 const pairs = new Set<string>();
5764 if (filePaths.length === 0) return pairs;
5765 for (let i = 0; i < filePaths.length; i += SQLITE_PARAM_CHUNK_SIZE) {
5766 const chunk = filePaths.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
5767 const placeholders = chunk.map(() => '?').join(',');
5768 const rows = this.db
5769 .prepare(`SELECT DISTINCT file_path, signature FROM nodes
5770 WHERE kind = 'import' AND file_path IN (${placeholders}) AND signature LIKE 'export%'`)
5771 .all(...chunk) as Array<{ file_path: string; signature: string }>;
5772 for (const row of rows) pairs.add(`${row.file_path}\0${row.signature}`);
5773 }
5774 return pairs;
5775 }
5776
5777 // ===========================================================================
5778 // Statistics

Callers 1

syncMethod · 0.80

Calls 5

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected