| 423 | } |
| 424 | |
| 425 | const getHighestEndLocation = (locations: SingleLocationData[]): SingleLocationData => { |
| 426 | return locations.reduce((highest, current) => { |
| 427 | if (current.location.end.line > highest.location.end.line) { |
| 428 | return current; |
| 429 | } |
| 430 | |
| 431 | if (highest.location.end.line === current.location.end.line) { |
| 432 | if (current.location.end.column > highest.location.end.column) { |
| 433 | return current; |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | return highest; |
| 438 | }, locations[0]); |
| 439 | }; |
| 440 | |
| 441 | const getLowestStartLocation = (locations: SingleLocationData[]): SingleLocationData => { |
| 442 | return locations.reduce((lowest, current) => { |