function IntervalTreeNode(mid, left, right, leftPoints, rightPoints) {
  this.mid = mid;
  this.left = left;
  this.right = right;
  this.leftPoints = leftPoints;
  this.rightPoints = rightPoints;
  this.count =
    (left ? left.count : 0) + (right ? right.count : 0) + leftPoints.length;
}
Binary Search Bounds
https://github.com/mikolalysenko/interval-tree-1d
Mikola Lysenko

Inlined because of Content Security Policy issue caused by the use of `new Function(...)` syntax in an upstream dependency.
Issue reported here: https://github.com/mikolalysenko/binary-search-bounds/issues/5