Skip to content

Commit

Permalink
fix(vulnerability-check): remove duplicated output
Browse files Browse the repository at this point in the history
  • Loading branch information
hdorgeval committed Jun 29, 2019
1 parent 1247566 commit d64fd5f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/validations/vulnerable-dependencies.js
Expand Up @@ -35,13 +35,17 @@ module.exports = {
audit(projectDir)
.then((result) => {
if (vulnerabilitiesFoundIn(result)) {
const errs = [];
const errs = new Set();
result.actions.forEach((action) => {
action.resolves.forEach((vulnerability) => {
errs.push(summaryOf(vulnerability));
errs.add(summaryOf(vulnerability));
});
});
reject(errs.sort());
const distinctAndSortedErrors = Array.from(
errs
).sort();

reject(distinctAndSortedErrors);
return;
}
if (auditErrorFoundIn(result)) {
Expand Down

0 comments on commit d64fd5f

Please sign in to comment.