"use strict";

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

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

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

var _fp = require("lodash/fp");

var _utils = require("../utils");

function maybeSetElements(config) {
  var _elements$config;

  return _utils.typesWithElements.includes(config === null || config === void 0 ? void 0 : config.type) ? (_elements$config = (0, _objectSpread2["default"])({
    elements: []
  }, config), (0, _fp.update)('elements', (0, _fp.map)(maybeSetElements))(_elements$config)) : config;
}
//# sourceMappingURL=maybeSetElements.cjs.map