intersect(other) {
        const start = Math.max(this.start, other.start);
        const end = Math.min(this.endExclusive, other.endExclusive);
        if (start <= end) {
            return new OffsetRange(start, end);
        }
        return undefined;
    }
for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n)

The resulting range is empty if the ranges do not intersect, but touch.
If the ranges don't even touch, the result is undefined.