tiptap/packages/core/src/helpers/isTextSelection.ts

7 lines
235 B
TypeScript
Raw Normal View History

2021-01-23 06:56:33 +08:00
import { TextSelection } from 'prosemirror-state'
import { isObject } from '../utilities/isObject'
2021-01-23 06:56:33 +08:00
export function isTextSelection(value: unknown): value is TextSelection {
2021-01-23 06:56:33 +08:00
return isObject(value) && value instanceof TextSelection
}