'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
function ensureMainFile(versionModel) {
  if (!versionModel.mainFile) {
    // Find the first file which is not test file
    var mainFile = versionModel.files.find(function (file) {
      return !file.test;
    });
    versionModel.mainFile = mainFile.relativePath;
  }
  return versionModel;
}

exports.default = {
  name: 'ensure main file exists',
  migrate: ensureMainFile
};