Files
tiptap/packages/core/src/helpers/findParentNode.ts
2021-01-25 13:39:35 +01:00

8 lines
309 B
TypeScript

import { Selection } from 'prosemirror-state'
import findParentNodeClosestToPos from './findParentNodeClosestToPos'
import { Predicate } from '../types'
export default function findParentNode(predicate: Predicate) {
return (selection: Selection) => findParentNodeClosestToPos(selection.$from, predicate)
}