"use strict";

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

/**
 * When a component has ImportSpecifier data, change it from an object to an array
 */
function updateImportSpecifiers(versionModel) {
  if (!versionModel.dependencies || !versionModel.dependencies.length) return versionModel;
  versionModel.dependencies.forEach(dependency => {
    dependency.relativePaths.forEach(relativePath => {
      if (relativePath.importSpecifier) {
        relativePath.importSpecifiers = [relativePath.importSpecifier];
        delete relativePath.importSpecifier;
      }
    });
  });
  return versionModel;
}

var _default = {
  name: 'change ImportSpecifier from Object to Array',
  migrate: updateImportSpecifiers
};
exports.default = _default;