( range: ExploreLineRange, served: ReadonlyArray<ExploreLineRange>, )
| 115 | |
| 116 | /** The parts of `range` that `served` covers. */ |
| 117 | export function intersectRange( |
| 118 | range: ExploreLineRange, |
| 119 | served: ReadonlyArray<ExploreLineRange>, |
| 120 | ): ExploreLineRange[] { |
| 121 | const out: ExploreLineRange[] = []; |
| 122 | for (const s of served) { |
| 123 | const start = Math.max(range.start, s.start); |
| 124 | const end = Math.min(range.end, s.end); |
| 125 | if (end >= start) out.push({ start, end }); |
| 126 | } |
| 127 | return mergeRanges(out); |
| 128 | } |
| 129 | |
| 130 | /** The parts of `range` that `cut` does NOT cover. */ |
| 131 | export function subtractRange( |
no test coverage detected