packages/kocha/src/reporters/json.js
function errorJSON (err) {
  var res = {}
  Object.getOwnPropertyNames(err).forEach(function (key) {
    res[key] = err[key]
  }, err)
  return res
}
function errorJSON (err) {
  var res = {}
  Object.getOwnPropertyNames(err).forEach(function (key) {
    res[key] = err[key]
  }, err)
  return res
}
function errorJSON ( err ) { var res = { } Object . getOwnPropertyNames ( err ) . forEach ( function ( key ) { res [ key ] = err [ key ] } , err ) return res }
Transform `error` into a JSON object.

@api private
@param {Error} err
@return {Object}
Transform error into a JSON object .