feat: add findChildrenInRange helper

This commit is contained in:
Philipp Kühn
2021-05-17 11:29:41 +02:00
parent 2bd17c7dc6
commit 463661c5ed
4 changed files with 27 additions and 6 deletions

View File

@@ -1,10 +1,5 @@
import { Node as ProseMirrorNode } from 'prosemirror-model'
import { Predicate } from '../types'
type NodeWithPos = {
node: ProseMirrorNode,
pos: number,
}
import { Predicate, NodeWithPos } from '../types'
export default function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[] {
const nodesWithPos: NodeWithPos[] = []