"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isValidPosition = void 0;
// checks if the given position is within the ProseMirror document
var isValidPosition = exports.isValidPosition = function isValidPosition(pos, state) {
  if (typeof pos !== 'number') {
    return false;
  }
  if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
    return true;
  }
  return false;
};