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()
Draw a string or numeric tree into a non-empty array of string rows.
At the key
unlinesyou will find a version the returns a string of the joined rows.At the key
numericyou will find a version that draws numeric trees, and it too has a keyunlineswith 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
numericandunlinesvariants, that draws the tree at the given theme.