inferActionsFromArgTypesRegex = function inferActionsFromArgTypesRegex(context) {
  var initialArgs = context.initialArgs,
      argTypes = context.argTypes,
      actions = context.parameters.actions;

  if (!actions || actions.disable || !actions.argTypesRegex || !argTypes) {
    return {};
  }

  var argTypesRegex = new RegExp(actions.argTypesRegex);
  var argTypesMatchingRegex = Object.entries(argTypes).filter(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 1),
        name = _ref2[0];

    return !!argTypesRegex.test(name);
  });
  return argTypesMatchingRegex.reduce(function (acc, _ref3) {
    var _ref4 = _slicedToArray(_ref3, 2),
        name = _ref4[0],
        argType = _ref4[1];

    if (typeof initialArgs[name] === 'undefined') {
      acc[name] = (0,_index__WEBPACK_IMPORTED_MODULE_15__.action)(name);
    }

    return acc;
  }, {});
}
Automatically add action args for argTypes whose name
matches a regex, such as `^on.*` for react-style `onClick` etc.