From 507b6e24d0d663d69d152e733acfa7b2c51dcf92 Mon Sep 17 00:00:00 2001 From: Gas <86567384+gas1cent@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:00:08 +0400 Subject: [PATCH] fix: interfaces are sometimes included in the output (#50) --- src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index e0b661e..ac1631e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -261,7 +261,9 @@ export async function getSourceUnits(rootPath: string, contractsDirectories: str includePath: [rootPath], }); - const sourceUnits = new ASTReader().read(compiledFiles.data, ASTKind.Any, compiledFiles.files); + const sourceUnits = new ASTReader().read(compiledFiles.data, ASTKind.Any, compiledFiles.files) + // Skip source units that are not in the contracts directories + .filter((sourceUnit) => contractsDirectories.some((directory) => sourceUnit.absolutePath.includes(directory))); return sourceUnits; }