'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
function toFiles(versionModel) {
  if (versionModel.impl) {
    versionModel.files = versionModel.files || [];
    var file = {
      file: versionModel.impl.file,
      name: versionModel.impl.name,
      relativePath: versionModel.impl.name,
      test: false
    };
    versionModel.files.push(file);
    delete versionModel.impl;
  }
  if (versionModel.dist) {
    versionModel.dists = versionModel.dists || [];
    var _file = {
      file: versionModel.dist.file,
      name: versionModel.dist.name,
      relativePath: versionModel.dist.name,
      test: false
    };
    versionModel.dists.push(_file);
    delete versionModel.dist;
  }
  if (versionModel.specs) {
    versionModel.files = versionModel.files || [];
    var _file2 = {
      file: versionModel.specs.file,
      name: versionModel.specs.name,
      relativePath: versionModel.specs.name,
      test: true
    };
    versionModel.files.push(_file2);
    delete versionModel.specs;
  }
  return versionModel;
}

exports.default = {
  name: 'convert impl / specs to files array',
  migrate: toFiles
};