code: function treeFromPaths (files, parent, renderLabelFn) {
    var groups = _.groupBy(files, file => file.match(/^[^/]*\/?/))
    return Object.keys(groups).map(function (groupKey) {
      const group = groups[groupKey]
      // Is this group explicitly part of the result, or
      // just implicit through its children
      const explicit = group.indexOf(groupKey) >= 0
      return {
        label: renderLabelFn({ parent, file: groupKey, explicit }),
        nodes: treeFromPaths(
          // Remove parent directory from file paths
          group
            .map(node => node.substr(groupKey.length))
            // Skip the empty path
            .filter(node => node),
          // New parent..., add intermediate slash if necessary
          parent.replace(/\/?$/, '/') + groupKey,
          renderLabelFn
        )
      }
    })
  }
docs: Transform an array of paths into an [archy](https://www.npmjs.com/package/archy)-compatible tree structure.
  
  ```
  [ [ 'abc/cde/efg/' ], [ 'abc/cde/abc'], ['abc/zyx'] ]
  ```
  becomes
  ```
  {
  label: 'abc/',
  nodes: [{ label: 'cde/',nodes: ['efg/', 'abc']}, 'zyx']
  }
  ```
  
  Nodes with a single subnode are collapsed and the resulting node gets the label `node/subnode`.
  
  @param {string[]} files an array of sorted file paths relative to `parent`
  @param {string} parent the directory of the files
  @param {function({parent:string, file:string, explicit: boolean}):string} renderLabelFn function that renders the label
  of a node. It receives the parent and a filenpath as parameters.
  @returns {object} a tree structure as needed by [archy](https://www.npmjs.com/package/archy)
  @access private