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

    Function drawTree

    • Draw a string or numeric tree into a non-empty array of string rows.

      At the key unlines you will find a version the returns a string of the joined rows.

      At the key numeric you will find a version that draws numeric trees, and it too has a key unlines with a version that draws to strings rather than an array of rows.

      At each key named after a theme name, you will find a version of the function with its numeric and unlines variants, that draws the tree at the given theme.

      Parameters

      Returns [string, ...string[]]

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

      const stringTree = of('foo')
      const numericTree = of(42)

      // Draw a string tree into arrays of rows using default theme.
      expect(drawTree(stringTree)).toMatchInlineSnapshot()

      // Draw a numeric tree into arrays of rows using default theme.
      expect(drawTree.number(numericTree)).toMatchInlineSnapshot()

      // Draw string trees to a string using default theme, when you must use
      // `console.log`, for example.
      expect(drawTree.unlines(stringTree)).toMatchInlineSnapshot()

      // Draw numeric trees to a string using default theme.
      expect(drawTree.number.unlines(numericTree)).toMatchInlineSnapshot()

      // Draw string trees using a specific theme into rows.
      expect(drawTree.ascii(stringTree)).toMatchInlineSnapshot()

      // Draw string trees using a specific theme into a string.
      expect(drawTree.ascii.unlines(stringTree)).toMatchInlineSnapshot()

      // Draw numeric trees using a specific theme into rows.
      expect(drawTree.ascii.number(numericTree)).toMatchInlineSnapshot()

      // Draw numeric trees using a specific theme into a string.
      expect(drawTree.ascii.number.unlines(numericTree)).toMatchInlineSnapshot()
    Index

    Properties

    bullets: EnrichedDraw
    dashed: EnrichedDraw
    dashedWide: EnrichedDraw
    dotted: EnrichedDraw
    double: EnrichedDraw
    hDouble: EnrichedDraw
    hThick: EnrichedDraw
    hThickDashed: EnrichedDraw
    hThickDashedWide: EnrichedDraw
    hThickDotted: EnrichedDraw
    number: UnlinesDraw<number>
    thickDashed: EnrichedDraw
    thickDashedWide: EnrichedDraw
    thickDotted: EnrichedDraw
    unixRound: EnrichedDraw
    unlines: BaseDraw<string, string>
    vDouble: EnrichedDraw
    vThick: EnrichedDraw
    vThickDashed: EnrichedDraw
    vThickDashedWide: EnrichedDraw
    vThickDotted: EnrichedDraw