var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import React from 'react';
import getDisplayName from './getDisplayName';
/**
 * Applies a mapping function over the props for a component.
 * @param {function(object): object} map The mapping function to apply to the props
 * @returns {function(Component): Component} HOC that will apply the provided mapping function
 */
var mapProps = function (map) { return function (WrappedComponent) {
    var MappedPropsComponent = React.forwardRef(function (props, ref) {
        return React.createElement(WrappedComponent, __assign({ ref: ref }, map(props)));
    });
    MappedPropsComponent.displayName = "MappedPropsComponent(" + getDisplayName(WrappedComponent) + ")";
    return MappedPropsComponent;
}; };
export default mapProps;
//# sourceMappingURL=mapProps.js.map