diff --git a/src/middleware/pretty-json/index.ts b/src/middleware/pretty-json/index.ts index c2cb0d4dc..a8b264979 100644 --- a/src/middleware/pretty-json/index.ts +++ b/src/middleware/pretty-json/index.ts @@ -30,7 +30,7 @@ type prettyOptions = { */ export const prettyJSON = (options: prettyOptions = { space: 2 }): MiddlewareHandler => { return async function prettyJSON(c, next) { - const pretty = c.req.query('pretty') || c.req.query('pretty') === '' ? true : false + const pretty = c.req.query('pretty') || c.req.query('pretty') === '' await next() if (pretty && c.res.headers.get('Content-Type')?.startsWith('application/json')) { const obj = await c.res.json()