Skip to content
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:

  • -1 if pointA is before pointB
  • 0 if pointA and pointB are equal
  • 1 if pointA is after pointB.

Compares the two points by document order, resolved at any depth. When the paths are equal, compares offsets.

TraversalSnapshot

EditorSelectionPoint

EditorSelectionPoint

-1 | 0 | 1