issue-position.js 488 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.compareIssuePositions = void 0;
  4. function compareIssuePositions(positionA, positionB) {
  5. if (positionA === positionB) {
  6. return 0;
  7. }
  8. if (!positionA) {
  9. return -1;
  10. }
  11. if (!positionB) {
  12. return 1;
  13. }
  14. return (Math.sign(positionA.line - positionB.line) || Math.sign(positionA.column - positionB.column));
  15. }
  16. exports.compareIssuePositions = compareIssuePositions;