'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _constants;

function _load_constants() {
  return _constants = require('../../../constants');
}

/**
 * Add default binding prefix to version model
 * @param {*} versionModel - The parsed component model
 */
function removeLatestFromCompiler(versionModel) {
  if (versionModel.compiler && versionModel.compiler.indexOf((_constants || _load_constants()).LATEST) > -1) {
    console.log('replacing before: ', versionModel.compiler);
    versionModel.compiler = versionModel.compiler.replace(`${(_constants || _load_constants()).VERSION_DELIMITER}${(_constants || _load_constants()).LATEST}`, '');
    console.log('replacing after: ', versionModel.compiler);
  }
  return versionModel;
}


var removeLatestFromCompilerDeclartaion = {
  name: 'remove latest from compiler',
  migrate: removeLatestFromCompiler
};

exports.default = removeLatestFromCompilerDeclartaion;