"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _utilDeprecate = _interopRequireDefault(require("util-deprecate"));

var _legacyMode = require("../../legacyMode");

var _excluded = ["name"];
var nameAsTitle = (0, _utilDeprecate["default"])(function (_ref, props) {
  var name = _ref.name,
      config = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
  (0, _legacyMode.setLegacyMode)();
  return (0, _objectSpread2["default"])({
    title: name
  }, config);
}, 'config.name is deprecated. Use config.title instead.');

var _default = function _default(config) {
  if (config.name) {
    config = nameAsTitle(config);
  }

  return config;
};

exports["default"] = _default;
//# sourceMappingURL=nameAsTitle.cjs.map