code: function ancestorSearch (getValue, value, isAncestor, tree) {
      if (getValue(tree) === value) {
        return tree;
      }
  
      var index = binaryIndexBy(getValue, value, tree.children);
      var child1 = tree.children[index];
      var child0 = tree.children[index - 1];
  
      if (child1 && isAncestor(value, child1)) {
        return ancestorSearch(getValue, value, isAncestor, child1);
      }
  
      if (child0 && isAncestor(value, child0)) {
        return ancestorSearch(getValue, value, isAncestor, child0);
      }
  
      return tree;
    }
docs: Searches a tree for the provided topic. If it cannot find a node with the topic, it returns the closest ancestor. `getValue(node) === value` means that the exact node was found