add getNodeType
This commit is contained in:
9
packages/core/src/utils/getNodeType.ts
Normal file
9
packages/core/src/utils/getNodeType.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NodeType, Schema } from 'prosemirror-model'
|
||||
|
||||
export default function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType {
|
||||
if (typeof nameOrType === 'string') {
|
||||
return schema.nodes[nameOrType]
|
||||
}
|
||||
|
||||
return nameOrType
|
||||
}
|
||||
Reference in New Issue
Block a user