This page is available as Markdown at /api/traversal/functions/comparepoints.md. For the full documentation index, see /llms.txt, or the complete corpus at /llms-full.txt.
comparePoints
comparePoints(
snapshot,pointA,pointB):-1|0|1
Defined in: compare-points.ts:17
Returns:
-1ifpointAis beforepointB0ifpointAandpointBare equal1ifpointAis afterpointB.
Compares the two points by document order, resolved at any depth. When the paths are equal, compares offsets.
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”TraversalSnapshot
pointA
Section titled “pointA”EditorSelectionPoint
pointB
Section titled “pointB”EditorSelectionPoint
Returns
Section titled “Returns”-1 | 0 | 1