UNPKG

@atlaskit/editor-plugin-show-diff

Version:

ShowDiff plugin for @atlaskit/editor-core

11 lines (10 loc) • 621 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isEmptyParagraphSlice = void 0; /** Whether a slice contains exactly one structurally empty paragraph. */ var isEmptyParagraphSlice = exports.isEmptyParagraphSlice = function isEmptyParagraphSlice(slice) { var _slice$content$firstC; return (slice === null || slice === void 0 ? void 0 : slice.content.childCount) === 1 && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type.name) === 'paragraph' && slice.content.firstChild.content.size === 0; };