Skip to content

Commit

Permalink
patch(vest): simplify severity count
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Mar 31, 2022
1 parent 472e4cc commit 65a8a38
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/vest/src/core/suite/produce/Severity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import invariant from 'invariant';

export enum Severity {
WARNINGS = 'warnings',
ERRORS = 'errors',
Expand All @@ -11,12 +9,7 @@ export enum SeverityCount {
}

export function countKeyBySeverity(severity: Severity): SeverityCount {
switch (severity) {
case Severity.ERRORS:
return SeverityCount.ERROR_COUNT;
case Severity.WARNINGS:
return SeverityCount.WARN_COUNT;
default:
invariant(false);
}
return severity === Severity.ERRORS
? SeverityCount.ERROR_COUNT
: SeverityCount.WARN_COUNT;
}

0 comments on commit 65a8a38

Please sign in to comment.