/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import isFunction from 'lodash/isFunction';
import isString from 'lodash/isString';
import { getPropsApiByEvent } from './helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/defineProperty';
import 'lodash/camelCase';
import 'lodash/isUndefined';
import 'lodash/isNull';
import 'lodash/isArray';
import 'lodash/isNumber';

function emitEvent(vm, eventName) {
  var _vm$$props;
  var emitEventMethodName;
  if (isString(eventName)) emitEventMethodName = getPropsApiByEvent(eventName);
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  if (isFunction(vm.$props[emitEventMethodName])) (_vm$$props = vm.$props)[emitEventMethodName].apply(_vm$$props, args);else vm.$emit.apply(vm, [eventName].concat(args));
}

export { emitEvent };
//# sourceMappingURL=event.js.map
