add nodeEqualsType util

This commit is contained in:
Philipp Kühn 2019-07-23 18:30:25 +02:00
parent f13e767518
commit 6049b5a318
2 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
export { default as getMarkAttrs } from './utils/getMarkAttrs'
export { default as getMarkRange } from './utils/getMarkRange'
export { default as markIsActive } from './utils/markIsActive'
export { default as nodeEqualsType } from './utils/nodeEqualsType'
export { default as nodeIsActive } from './utils/nodeIsActive'

View File

@ -0,0 +1,3 @@
export default function nodeEqualsType({ types, node }) {
return (Array.isArray(types) && types.includes(node.type)) || node.type === types
}