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

    Function firstChild

    • Return the first child tree of a branch.

      Type Parameters

      • A

        Underlying tree type.

      Parameters

      Returns Tree<A>

      The tree that is first in the forest of the given branch.

      import * as Tree from 'effect-tree'

      const branch = Tree.branch(2, [Tree.of(1), Tree.of(2)])

      expect(Tree.firstChild(branch)).toEqual(Tree.of(1))