@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
8 lines • 318 B
JavaScript
// When experiment platform_editor_prosemirror_rendered_data is removed, review whether this helper is still needed.
export function getNodesCount(node) {
var count = {};
node.nodesBetween(0, node.nodeSize - 2, function (node) {
count[node.type.name] = (count[node.type.name] || 0) + 1;
});
return count;
}