import { shouldUpdate } from "recompose";
import _ from "lodash";
var isEq = function isEq(o1, o2) {
  var isEq = _.isEqualWith(o1, o2, function (val1, val2) {
    if (_.isFunction(val1) && _.isFunction(val2)) {
      return val1 === val2 || val1.toString() === val2.toString();
    }
  });
  return isEq;
};
var pure = function pure(BaseComponent) {
  var hoc = shouldUpdate(function (props, nextProps) {
    return !isEq(props, nextProps);
  });
  return hoc(BaseComponent);
};
export default pure;