function rangeOverlap(left1, right1, left2, right2) {
  if (right1 <= left2) return RangeOverlap.LEFT;
  if (left1 >= right2) return RangeOverlap.RIGHT;
  const leftIn = left1 >= left2;
  const rightIn = right1 <= right2;
  if (leftIn && rightIn) return RangeOverlap.IN;
  if (leftIn) return RangeOverlap.RIGHT_IN;
  if (rightIn) return RangeOverlap.LEFT_IN;
  return RangeOverlap.CONTAINS;
}
Computes how two one dimensional ranges overlap.

@param {number} left1 Left inclusive bound of the first range.
@param {number} right1 Right exclusive bound of the first range.
@param {number} left2 Left inclusive bound of the second range.
@param {number} right2 Right exclusive bound of the second range.
@return {RangeOverlap} The enum value describing the type of the overlap.