issue-location.js 798 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.formatIssueLocation = exports.compareIssueLocations = void 0;
  4. const issue_position_1 = require("./issue-position");
  5. function compareIssueLocations(locationA, locationB) {
  6. if (locationA === locationB) {
  7. return 0;
  8. }
  9. if (!locationA) {
  10. return -1;
  11. }
  12. if (!locationB) {
  13. return 1;
  14. }
  15. return ((0, issue_position_1.compareIssuePositions)(locationA.start, locationB.start) ||
  16. (0, issue_position_1.compareIssuePositions)(locationA.end, locationB.end));
  17. }
  18. exports.compareIssueLocations = compareIssueLocations;
  19. function formatIssueLocation(location) {
  20. return `${location.start.line}:${location.start.column}`;
  21. }
  22. exports.formatIssueLocation = formatIssueLocation;