resources/js/wysiwyg/lexical/core/LexicalMutations.ts
Function $flushMutations
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function $flushMutations(
editor: LexicalEditor,
mutations: Array<MutationRecord>,
observer: MutationObserver,
): void {
Avoid deeply nested control flow statements. Open
Open
if (correctDOM === null) {
continue;
}
Avoid deeply nested control flow statements. Open
Open
for (let s = 0; s < removedDOMsLength; s++) {
const removedDOM = removedDOMs[s];
if (
(removedDOM.nodeName === 'BR' &&
Avoid deeply nested control flow statements. Open
Open
if (currentDOM == null) {
targetDOM.appendChild(correctDOM);
currentDOM = correctDOM;
} else if (currentDOM !== correctDOM) {
targetDOM.replaceChild(correctDOM, currentDOM);
Avoid deeply nested control flow statements. Open
Open
if (
parentDOM != null &&
addedDOM !== blockCursorElement &&
node === null &&
(addedDOM.nodeName !== 'BR' ||
Avoid deeply nested control flow statements. Open
Open
if (removedDOMsLength !== unremovedBRs) {
if (targetDOM === rootElement) {
targetNode = internalGetRoot(currentEditorState);
}