handlebars/helpers/index.js
function transformTree (object, fn) {
  const label = fn(object).trim()
  if (object.children) {
    return {
      label: label,
      nodes: object.children.map(function (child) {
        return transformTree(child, fn)
      })
    }
  } else {
    return label
  }
}
function transformTree (object, fn) {
  const label = fn(object).trim()
  if (object.children) {
    return {
      label: label,
      nodes: object.children.map(function (child) {
        return transformTree(child, fn)
      })
    }
  } else {
    return label
  }
}
function transformTree ( object , fn ) { const label = fn ( object ) . trim ( ) if ( object . children ) { return { label : label , nodes : object . children . map ( function ( child ) { return transformTree ( child , fn ) } ) } } else { return label } }
Transfrom an object hierarchy into `archy`'s format

Transform a tree-structure of the form
```
{
prop1: 'value',
prop2: 'value',
...,
children: [
{
prop1: 'value',
propt2: 'value',
...,
children: ...
}
]
}
```
Into an [archy](https://www.npmjs.com/package/archy)-compatible format, by passing each node to a block-helper function.
The result of the function should be a string which is then used as label for the node.

@param {object} object the tree data
@param fn the block-helper function (options.fn) of Handlebars (http://handlebarsjs.com/block_helpers.html)

@access private
Transfrom an object hierarchy into archy s format