"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isSelectionAtEndOfNode = void 0;
var isSelectionAtEndOfNode = exports.isSelectionAtEndOfNode = function isSelectionAtEndOfNode($pos, parentNode) {
  if (!parentNode) {
    return false;
  }
  for (var i = $pos.depth + 1; i > 0; i--) {
    var node = $pos.node(i);
    if (node && node.eq(parentNode)) {
      break;
    }
    if (i > 1 && $pos.after(i) !== $pos.after(i - 1) - 1) {
      return false;
    }
  }
  return true;
};