import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["name"];
import deprecate from 'util-deprecate';
import { setLegacyMode } from '../../legacyMode';
var nameAsTitle = deprecate(function (_ref, props) {
  var name = _ref.name,
      config = _objectWithoutProperties(_ref, _excluded);

  setLegacyMode();
  return _objectSpread({
    title: name
  }, config);
}, 'config.name is deprecated. Use config.title instead.');
export default (function (config) {
  if (config.name) {
    config = nameAsTitle(config);
  }

  return config;
});
//# sourceMappingURL=nameAsTitle.js.map