'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };

exports.default = parseArgs;
function parseArgs() {
  var event = null;
  var values = {};
  var callback = function callback() {};

  for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  if (typeof args[args.length - 1] === 'function') {
    callback = args.pop();
  }

  if (_typeof(args[0]) === 'object') {
    event = args[0].event;

    if (_typeof(args[0].values) === 'object') {
      values = {
        value1: args[0].values.value1,
        value2: args[0].values.value2,
        value3: args[0].values.value3
      };
    }
  } else {
    event = args[0];
    values = {
      value1: args[1],
      value2: args[2],
      value3: args[3]
    };
  }

  return {
    event: event,
    values: values,
    callback: callback
  };
}