effect-tree - v1.0.36
    Preparing search index...

    Function isRoot

    • True if the zipper is currently focused on the tree root node.

      Type Parameters

      • A

        Underlying tree type.

      Parameters

      Returns boolean

      True if zipper is at root else false.

      import {Zipper, from, of} from 'effect-tree'

      const tree = from(1, of(2), of(3))

      const zipper = Zipper.fromTree(tree)

      expect(Zipper.isRoot(zipper)).toBe(true)

      const moved = Zipper.head(zipper)

      expect(Zipper.isRoot(moved)).toBe(false)