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

    Function getForest

    • Get the forest of the tree node under focus. Result could be an empty list if the focused node is a Leaf.

      Type Parameters

      • A

        Underlying tree type.

      Parameters

      Returns readonly Tree<A>[]

      A possibly empty list of trees.

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

      const tree = from(1, of(2))
      const zipper = Zipper.fromTree(tree)

      expect(Zipper.getForest(zipper)).toEqual([of(2)])