src/middleware/debug.js
function tryFormat(body) {
  try {
    const parsed = typeof body === 'string' ? JSON.parse(body) : body
    return JSON.stringify(parsed, null, 2)
  } catch (err) {
    return body
  }
}
function tryFormat(body) {
  try {
    const parsed = typeof body === 'string' ? JSON.parse(body) : body
    return JSON.stringify(parsed, null, 2)
  } catch (err) {
    return body
  }
}
function tryFormat ( body ) { try { const parsed = typeof body === 'string' ? JSON . parse ( body ) : body return JSON . stringify ( parsed , null , 2 ) } catch ( err ) { return body } }
Attempt pretty-formatting JSON
Attempt pretty - formatting JSON