import isPlainObject from "lodash/isPlainObject";
import forOwn from "lodash/forOwn";
import isArray from "lodash/isArray";
function deepCopyExcept(data, callback) {
  var dest, i, shouldExcept, newValue;
  if (isPlainObject(data)) {
    dest = {};
    forOwn(data, function (value, key) {
      newValue = deepCopyExcept(value, callback);
      shouldExcept = callback(newValue, key);
      if (!shouldExcept) {
        dest[key] = newValue;
      }
    });
  } else if (isArray(data)) {
    dest = [];
    for (i = 0; i < data.length; i++) {
      newValue = deepCopyExcept(data[i], callback);
      shouldExcept = callback(newValue, i);
      if (!shouldExcept) {
        dest.push(newValue);
      }
    }
  } else {
    return data;
  }
  return dest;
}
;
export default function getCleanRowData(rowData) {
  if (rowData) {
    var blackList = ['__mode__', '__fields__', '__expand__'];
    return deepCopyExcept(rowData, function (value, key) {
      return blackList.indexOf(key) !== -1;
    });
  }
}