code: function filesToTree(part) {
  
    var fileObjects = [];
  
    _.each(part.files, function(file) {
  
      if(_.isString(file)) {
  
        // If there is no objects in the array, or the latest object
        // is a part, create a non-part object to hold the files.
        if(fileObjects.length == 0 || _.last(fileObjects).label) {
          var vars = _.omit(part, ['files', 'parent', 'vars']);
          fileObjects.push({ files: [], parent:part, vars: vars });
        }
  
        _.last(fileObjects).files.push(file);
      }
      else if(file.label && file.files) {
        var vars = _.omit(file, ['files', 'parent', 'vars']);
        var child = filesToTree({ label: file.label, files: file.files, parent:part, vars: vars});
        fileObjects.push(child);
      }
  
    });
  
    part.files = fileObjects;
    return part;
  }
docs: Turn a part into a full tree consisting of objects, so we later can store stream vinyl objects in the objects belonging to the blobs they were loaded from. Turns this: { files: [ "firstfile.md", "secondfile.md", { label: "Part", files: [ "thirdfile.md", { label: "Sub Part", files: ["fourthfile.md"] } ], myVariable: "Something" } ]} Into this: { files: [ { files: [ "firstfile.md", "secondfile.md" ] }, { label: "Part", files: [ { parent: {...}, files: ["thirdfile.md"] }, { parent: {...} label: "Sub Part", files: ["fourthfile.md"] } ], vars : { label: "Part", myVariable: "Something" } } ]}