"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.buildChildrenObject = void 0;
var _react = _interopRequireDefault(require("react"));
var buildChildrenObject = (children, childrenObject) => {
  return _react.default.Children.toArray(children).reduce((acc, child) => {
    if (! /*#__PURE__*/_react.default.isValidElement(child)) {
      return acc;
    }
    if (!child.type || !child.type.displayName) {
      return acc;
    }
    var name = child.type.displayName.split('.').pop();
    acc[name] = child;
    return acc;
  }, childrenObject || {});
};
exports.buildChildrenObject = buildChildrenObject;
//# sourceMappingURL=buildChildrenObject.js.map