fix: fix jserror

This commit is contained in:
fantasticit 2022-05-10 10:25:53 +08:00
parent 75d1dfa5e8
commit 776db2bc7f
1 changed files with 4 additions and 4 deletions

View File

@ -2,19 +2,19 @@ import { Node } from 'prosemirror-model';
import { EditorState } from 'prosemirror-state'; import { EditorState } from 'prosemirror-state';
export function isTitleNode(node: Node): boolean { export function isTitleNode(node: Node): boolean {
return node.type.name === 'title'; return node && node.type.name === 'title';
} }
export function isBulletListNode(node: Node): boolean { export function isBulletListNode(node: Node): boolean {
return node.type.name === 'bulletList'; return node && node.type.name === 'bulletList';
} }
export function isOrderedListNode(node: Node): boolean { export function isOrderedListNode(node: Node): boolean {
return node.type.name === 'orderedList'; return node && node.type.name === 'orderedList';
} }
export function isTodoListNode(node: Node): boolean { export function isTodoListNode(node: Node): boolean {
return node.type.name === 'taskList'; return node && node.type.name === 'taskList';
} }
export function isListNode(node: Node): boolean { export function isListNode(node: Node): boolean {