"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.extractSliceFromStep = void 0;
var _transform = require("@atlaskit/editor-prosemirror/transform");
var extractSliceFromStep = exports.extractSliceFromStep = function extractSliceFromStep(step) {
  if (!(step instanceof _transform.ReplaceStep) && !(step instanceof _transform.ReplaceAroundStep)) {
    return null;
  }

  // @ts-ignore This is by design. Slice is a private property, but accesible, from ReplaceStep.
  // However, we need to read it to found if the step was adding a newline
  var slice = step.slice;
  return slice;
};