effect-tree
    Preparing search index...

    Function nAryTree

    • Create an N-ary level tree with the given degree at the given depth. In a level tree, the value of each node is set to its depth. An N-ary tree is one where all nodes, except the leaves, have the same child count.

      At the key string you will find a version that returns the tree where nodes have been formatted as strings instead of number.

      Parameters

      • settings: { degree: number; depth: number }

        The child count for all nodes except leaves, and the tree depth requested.

      Returns Tree<number>

      An N-ary level tree of the given depth..

      import {nAryTree, drawTree} from 'effect-tree'

      const tree = nAryTree({depth: 2, degree: 4})

      console.log(drawTree.unlines(tree))

      // ┬1
      // ├─2
      // ├─2
      // ├─2
      // └─2
    Index

    Properties

    Properties

    string: (...a: [{ degree: number; depth: number }]) => Tree