import _typeof from "@babel/runtime/helpers/typeof";
export var errorProps = ['message', 'name', 'fileName', 'lineNumber', 'line', 'columnNumber', 'column', 'stack'];
export default function cloneError(error) {
  if (!error || _typeof(error) !== 'object') return {};
  var clone = {};

  for (var _i = 0; _i < errorProps.length; _i++) {
    var key = errorProps[_i];

    if (key in error) {
      clone[key] = error[key];
    }
  }

  return clone;
}