IssueSeverity.js 740 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var IssueSeverity = {
  4. ERROR: 'error',
  5. WARNING: 'warning'
  6. };
  7. exports.IssueSeverity = IssueSeverity;
  8. function isIssueSeverity(value) {
  9. return [IssueSeverity.ERROR, IssueSeverity.WARNING].includes(value);
  10. }
  11. exports.isIssueSeverity = isIssueSeverity;
  12. function compareIssueSeverities(severityA, severityB) {
  13. var _a = [severityA, severityB].map(function (severity) {
  14. return [IssueSeverity.WARNING /* 0 */, IssueSeverity.ERROR /* 1 */].indexOf(severity);
  15. }), priorityA = _a[0], priorityB = _a[1];
  16. return Math.sign(priorityB - priorityA);
  17. }
  18. exports.compareIssueSeverities = compareIssueSeverities;
  19. //# sourceMappingURL=IssueSeverity.js.map