code: function findNodeAround(node, pos, test, base, state) {
    test = makeTest(test);
    if (!base) base = exports.base;
    try {
      ;(function c(node, st, override) {
        var type = override || node.type;
        if (node.start > pos || node.end < pos) return;
        base[type](node, st, c);
        if (test(type, node)) throw new Found(node, st);
      })(node, state);
    } catch (e) {
      if (e instanceof Found) return e;
      throw e;
    }
  }
docs: Find the innermost node of a given type that contains the given position. Interface similar to findNodeAt.