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

Method getReExportStatementsByFiles

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

5879 * plain `import` does not. Same shape as {@link getNodeNamePairsByFiles}.
5880 */
5881 getReExportStatementsByFiles(filePaths: string[]): Set<string> {
5882 const pairs = new Set<string>();
5883 if (filePaths.length === 0) return pairs;
5884 for (let i = 0; i < filePaths.length; i += SQLITE_PARAM_CHUNK_SIZE) {
5885 const chunk = filePaths.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
5886 const placeholders = chunk.map(() => '?').join(',');
5887 const rows = this.db
5888 .prepare(`SELECT DISTINCT file_path, signature FROM nodes
5889 WHERE kind = 'import' AND file_path IN (${placeholders}) AND signature LIKE 'export%'`)
5890 .all(...chunk) as Array<{ file_path: string; signature: string }>;
5891 for (const row of rows) pairs.add(`${row.file_path}\0${row.signature}`);
5892 }
5893 return pairs;
5894 }
5895
5896 // ===========================================================================
5897 // 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