* 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[])
| 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 |