Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
oldChildren.forEach((next, i) => {
const prev = children[children.length - 1];
if (prev && typeof prev !== 'string' && typeof next !== 'string' && nodeMarks.get(prev) &&
nodeMarks.get(prev) === nodeMarks.get(next) && deepEqual(prev.attributes, next.attributes))
{
prev.children = prev.children.concat(next.children);
} else {
children.push(next);
if (prev && typeof prev !== 'string' && prev.children) {
prev.children = mergeChildren(prev.children);
}
}
});
if (children.length) {