import { Node } from 'prosemirror-model';
export default function nodeAt(doc, pos) {
  if (pos < 0 || pos > doc.content.size) {
    // Exit here or error will be thrown:
    // e.g. RangeError: Position outside of fragment.
    return null;
  }
  return doc.nodeAt(pos);
}