$getCommonAncestor
functionFind a common ancestor of a and b and return a detailed result object, or null if there is no common ancestor between the two nodes. The result object will have a commonAncestor property, and the other properties can be used to quickly compare these positions in the tree.
Import
import { $getCommonAncestor } from '@modular/sdk/editor';Notes
- returns
- A comparison result between the two nodes or null if they have no common ancestor