"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "getGlobalConfig", {
  enumerable: true,
  get: function get() {
    return _utils.getGlobalConfig;
  }
});
exports.getLovPara = getLovPara;
exports.processAxiosConfig = processAxiosConfig;

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

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

function getLovPara(field, record) {
  var lovPara = (0, _objectSpread2["default"])({}, field.get('lovPara', record));
  var cascadeMap = field.get('cascadeMap', record);

  if (record && cascadeMap) {
    Object.keys(cascadeMap).forEach(function (cascade) {
      return lovPara[cascade] = record.get(cascadeMap[cascade]);
    });
  }

  return lovPara;
}

function processAxiosConfig() {
  var axiosConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  if (typeof axiosConfig === 'function') {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    return axiosConfig.apply(void 0, args);
  }

  return axiosConfig;
}
//# sourceMappingURL=utils.js.map
