"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.removeNodeChildren = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
var _slate = require("slate");
const removeNodeChildren = (editor, path, options) => {
  const nodeChildren = _slate.Node.children(editor, path, {
    reverse: true
  });
  for (const [, childPath] of nodeChildren) {
    _slate.Transforms.removeNodes(editor, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, options), {}, {
      at: childPath
    }));
  }
};
exports.removeNodeChildren = removeNodeChildren;