"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function ensureMainFile(versionModel) {
  if (!versionModel.mainFile) {
    // Find the first file which is not test file
    const mainFile = versionModel.files.find(file => !file.test);
    versionModel.mainFile = mainFile.relativePath;
  }

  return versionModel;
}

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