Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
feat: adds support for critical severity
Browse files Browse the repository at this point in the history
  • Loading branch information
thisislawatts authored and bmvermeer committed Jun 2, 2021
1 parent 750edd8 commit 76d2035
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/report.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sort = ['high', 'medium', 'low'];
const sort = ['critical', 'high', 'medium', 'low'];
const sortBy = (a, b) => {
return sort.indexOf(a.severity) - sort.indexOf(b.severity);
};
Expand All @@ -11,7 +11,7 @@ export const summary = pkg => {
acc[sort.indexOf(curr.severity)]++;
return acc;
},
[0, 0, 0] // relies on the order of high, medium, low (based on `sort`)
[0, 0, 0] // relies on the order of critical, high, medium, low (based on `sort`)
)
.map((_, i) => `${_} ${sort[i]}`) // remaps to include the severit type
.filter(_ => _[0] !== '0') // drop those starting with zero
Expand Down

0 comments on commit 76d2035

Please sign in to comment.