import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import { mapValues } from 'lodash';
import commonPlugins from './commonPlugins';
import typePlugins from './typePlugins';
import * as builtInTypes from './types';
export default (function (props) {
  var _ref, _typeConverter;

  var types = _objectSpread(_objectSpread({}, mapValues(builtInTypes, function (type) {
    return type["default"];
  })), props.extraTypes);

  var typeConverter = typeof props.config.type === 'function' ? props.config.type : types[props.config.type];

  if (!typeConverter) {
    return {
      schema: {}
    };
  }

  return _objectSpread(_objectSpread({}, props), (_ref = (_typeConverter = typeConverter(props), typePlugins(props)(_typeConverter)), commonPlugins(props.config)(_ref)));
});
//# sourceMappingURL=index.js.map