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

    Function getLefts

    • Get the nodes to the left of the focus node.

      Type Parameters

      • A

        Underlying tree type.

      Parameters

      Returns Tree<A>[]

      Possibly empty list of trees.

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

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

      const zipper = pipe(
      tree,
      Zipper.fromTree,
      Zipper.head
      )

      expect(Zipper.getLefts(zipper)).toEqual([])

      const moved = Zipper.next(zipper)

      expect(Zipper.getLefts(moved)).toEqual([of(2)])