mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: omit non-source files
This commit is contained in:
1 parent
551108e047
commit
b5d61cebb3
1 file changed
+20
-15
@@ -87,24 +87,29 @@ function collectTypes(node: TypeNode) {
|
|||||||
if (!collected.has(name)) {
|
if (!collected.has(name)) {
|
||||||
const declarations = symbol.getDeclarations();
|
const declarations = symbol.getDeclarations();
|
||||||
|
|
||||||
if (declarations) {
|
if (!declarations) return;
|
||||||
declarations.forEach((declaration) => {
|
|
||||||
if (
|
|
||||||
!isInterfaceDeclaration(declaration) &&
|
|
||||||
!isTypeAliasDeclaration(declaration) &&
|
|
||||||
!isEnumDeclaration(declaration)
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const name = declaration.name.text;
|
declarations.forEach((declaration) => {
|
||||||
|
const source = declaration.getSourceFile();
|
||||||
|
const isInSource = roots.some((root) => source.fileName.startsWith(root));
|
||||||
|
|
||||||
if (collected.has(name)) return;
|
if (!isInSource) return;
|
||||||
|
|
||||||
collected.set(name, declaration.getText());
|
if (
|
||||||
forEachChild(declaration, collectTypesFromNode);
|
!isInterfaceDeclaration(declaration) &&
|
||||||
});
|
!isTypeAliasDeclaration(declaration) &&
|
||||||
}
|
!isEnumDeclaration(declaration)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const name = declaration.name.text;
|
||||||
|
|
||||||
|
if (collected.has(name)) return;
|
||||||
|
|
||||||
|
collected.set(name, declaration.getText());
|
||||||
|
forEachChild(declaration, collectTypesFromNode);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user