export function filterChildrenBetween(doc, from, to, predicate) {
  const results = [];
  doc.nodesBetween(from, to, (node, pos, parent) => {
    if (predicate(node, pos, parent)) {
      results.push({
        node,
        pos
      });
    }
  });
  return results;
}