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

    Function nodeCountAtLeast

    • True if node count is at least the given number. Will short-circuit when condition is reached rather than traverse entire tree.

      Parameters

      • atLeast: number

      Returns <A>(self: Tree<A>) => boolean

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

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

      expect(nodeCountAtLeast(3)(leaf), 'leaf').toBe(false)
      expect(nodeCountAtLeast(3)(tree), 'branch').toBe(true)