perf: prefilter extension boundary parsing

This commit is contained in:
Peter Steinberger
2026-04-11 13:02:56 +01:00
parent 850182b502
commit 48ac72f0ee
3 changed files with 13 additions and 0 deletions

View File

@@ -83,6 +83,9 @@ export async function collectTypeScriptInventory(params) {
let sourceFile = parsedTypeScriptSourceCache.get(cacheKey);
if (!sourceFile) {
const source = await fs.readFile(filePath, "utf8");
if (params.shouldParseSource && !params.shouldParseSource(source, filePath)) {
continue;
}
sourceFile = params.ts.createSourceFile(
filePath,
source,