mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +08:00

* use named exports instead of default exports * fix tests Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
9 lines
287 B
TypeScript
9 lines
287 B
TypeScript
import { Node as ProseMirrorNode } from 'prosemirror-model'
|
|
|
|
export function isNodeEmpty(node: ProseMirrorNode): boolean {
|
|
const defaultContent = node.type.createAndFill()?.toJSON()
|
|
const content = node.toJSON()
|
|
|
|
return JSON.stringify(defaultContent) === JSON.stringify(content)
|
|
}
|