IssueOrigin.js 867 B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var IssueOrigin = {
  4. TYPESCRIPT: 'typescript',
  5. ESLINT: 'eslint',
  6. INTERNAL: 'internal'
  7. };
  8. exports.IssueOrigin = IssueOrigin;
  9. function isIssueOrigin(value) {
  10. return [
  11. IssueOrigin.TYPESCRIPT,
  12. IssueOrigin.ESLINT,
  13. IssueOrigin.INTERNAL
  14. ].includes(value);
  15. }
  16. exports.isIssueOrigin = isIssueOrigin;
  17. function compareIssueOrigins(originA, originB) {
  18. var _a = [originA, originB].map(function (origin) {
  19. return [
  20. IssueOrigin.ESLINT /* 0 */,
  21. IssueOrigin.TYPESCRIPT /* 1 */,
  22. IssueOrigin.INTERNAL /* 2 */
  23. ].indexOf(origin);
  24. }), priorityA = _a[0], priorityB = _a[1];
  25. return Math.sign(priorityB - priorityA);
  26. }
  27. exports.compareIssueOrigins = compareIssueOrigins;
  28. //# sourceMappingURL=IssueOrigin.js.map