"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = runColumnActionCallback;
var _getCleanRowData = _interopRequireDefault(require("./getCleanRowData"));
function runColumnActionCallback(param) {
  var action = param.action,
    rowData = param.rowData,
    index = param.index;
  var _action$callback = action.callback,
    callback = _action$callback === void 0 ? function () {} : _action$callback;
  try {
    if (rowData && callback) {
      return Promise.resolve(callback((0, _getCleanRowData["default"])(rowData), action, index));
    }
  } catch (e) {
    if (e instanceof Error) {
      console.warn(e.stack);
    }
  }
  return Promise.reject();
}
;