refactoring
This commit is contained in:
@@ -2,6 +2,7 @@ import { EditorState } from 'prosemirror-state'
|
||||
import { Node, NodeType } from 'prosemirror-model'
|
||||
import objectIncludes from '../utilities/objectIncludes'
|
||||
import getNodeType from './getNodeType'
|
||||
import { AnyObject } from '../types'
|
||||
|
||||
export type NodeRange = {
|
||||
node: Node,
|
||||
@@ -12,7 +13,7 @@ export type NodeRange = {
|
||||
export default function isNodeActive(
|
||||
state: EditorState,
|
||||
typeOrName: NodeType | string | null,
|
||||
attributes = {},
|
||||
attributes: AnyObject = {},
|
||||
): boolean {
|
||||
const { from, to, empty } = state.selection
|
||||
const type = typeOrName
|
||||
|
||||
Reference in New Issue
Block a user