src/main/utils.js
function tupleRangeOverlaps(tupleRange1: Array<Array<number>>,
                            tupleRange2: Array<Array<number>>): boolean {
  return (
     // Are the ranges overlapping?
     tupleLessOrEqual(tupleRange1[0], tupleRange2[1]) &&
     tupleLessOrEqual(tupleRange2[0], tupleRange1[1]) &&
     // ... and non-empty?
     tupleLessOrEqual(tupleRange1[0], tupleRange1[1]) &&
     tupleLessOrEqual(tupleRange2[0], tupleRange2[1]));
}
function tupleRangeOverlaps(tupleRange1: Array<Array<number>>,
                            tupleRange2: Array<Array<number>>): boolean {
  return (
     // Are the ranges overlapping?
     tupleLessOrEqual(tupleRange1[0], tupleRange2[1]) &&
     tupleLessOrEqual(tupleRange2[0], tupleRange1[1]) &&
     // ... and non-empty?
     tupleLessOrEqual(tupleRange1[0], tupleRange1[1]) &&
     tupleLessOrEqual(tupleRange2[0], tupleRange2[1]));
}
function tupleRangeOverlaps ( tupleRange1 : Array < Array < number >> , tupleRange2 : Array < Array < number >> ) : boolean { return ( // Are the ranges overlapping? tupleLessOrEqual ( tupleRange1 [ 0 ] , tupleRange2 [ 1 ] ) && tupleLessOrEqual ( tupleRange2 [ 0 ] , tupleRange1 [ 1 ] ) && // ... and non-empty? tupleLessOrEqual ( tupleRange1 [ 0 ] , tupleRange1 [ 1 ] ) && tupleLessOrEqual ( tupleRange2 [ 0 ] , tupleRange2 [ 1 ] ) ) ; }
Do two ranges of tuples overlap? TODO: make this tupleRangeOverlaps<T> -- it works with strings or booleans, too.
Do two ranges of tuples overlap? TODO : make this tupleRangeOverlaps<T > -- it works with strings or booleans too .