lib/events.js
function _createEventRangeValidator(range) {
  var ctxRange = _createRangeArray(range);

  return function rangeValidator(range) {
    var leftIndex = 0;
    var rightIndex = 0;
    var left;
    var right;

    for (; leftIndex < ctxRange.length && rightIndex < range.length; ) {
      left = ctxRange[leftIndex];
      right = range[rightIndex];

      if (left.max < right.min) {
        ++leftIndex;
      } else if ((left.min <= right.min || left.max >= right.max) &&
                 ((left.min > right.min && (right.min !== Number.MIN_VALUE)) ||
                  (left.max < right.max) && (right.max !== Infinity))) {
        return false;
      } else {
        ++rightIndex;
      }
    }

    return (rightIndex >= range.length);
  };
}
function _createEventRangeValidator(range) {
  var ctxRange = _createRangeArray(range);

  return function rangeValidator(range) {
    var leftIndex = 0;
    var rightIndex = 0;
    var left;
    var right;

    for (; leftIndex < ctxRange.length && rightIndex < range.length; ) {
      left = ctxRange[leftIndex];
      right = range[rightIndex];

      if (left.max < right.min) {
        ++leftIndex;
      } else if ((left.min <= right.min || left.max >= right.max) &&
                 ((left.min > right.min && (right.min !== Number.MIN_VALUE)) ||
                  (left.max < right.max) && (right.max !== Infinity))) {
        return false;
      } else {
        ++rightIndex;
      }
    }

    return (rightIndex >= range.length);
  };
}
function _createEventRangeValidator ( range ) { var ctxRange = _createRangeArray ( range ) ; return function rangeValidator ( range ) { var leftIndex = 0 ; var rightIndex = 0 ; var left ; var right ; for ( ; leftIndex < ctxRange . length && rightIndex < range . length ; ) { left = ctxRange [ leftIndex ] ; right = range [ rightIndex ] ; if ( left . max < right . min ) { ++ leftIndex ; } else if ( ( left . min <= right . min || left . max >= right . max ) && ( ( left . min > right . min && ( right . min !== Number . MIN_VALUE ) ) || ( left . max < right . max ) && ( right . max !== Infinity ) ) ) { return false ; } else { ++ rightIndex ; } } return ( rightIndex >= range . length ) ; } ; }
Create a range validator. The returned value is a function validating if
a given range matches this range
Create a range validator . The returned value is a function validating if a given range matches this range