Skip to content

Commit

Permalink
Stop extra semicolons in exclude paths from preventing results
Browse files Browse the repository at this point in the history
  • Loading branch information
comp615 committed Aug 31, 2023
1 parent 28d4f1b commit 8c8ccee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions features/exclude-paths-from-report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ Scenario: Ignore none
Given file "exports.ts" is export const a = 1;
When analyzing "tsconfig.json" with files ["--excludePathsFromReport=other-1;other-2"]
Then the result is { "exports.ts": ["a"] }

Scenario: Extra semi-colons doesn't filter all results
Given file "exports.ts" is export const a = 1;
When analyzing "tsconfig.json" with files ["--excludePathsFromReport=other-1;;other-2;"]
Then the result is { "exports.ts": ["a"] }
4 changes: 3 additions & 1 deletion src/argsParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ function processOptions(
{
const paths = optionValue.split(';');
paths.forEach((path) => {
pathsToExcludeFromReport.push(path);
if (path) {
pathsToExcludeFromReport.push(path);
}
});
}
break;
Expand Down

0 comments on commit 8c8ccee

Please sign in to comment.