Skip to content

Commit

Permalink
refactor(pretty-json): remove useless condition (#2815)
Browse files Browse the repository at this point in the history
  • Loading branch information
6km authored May 27, 2024
1 parent 0309060 commit d6fa9d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware/pretty-json/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d6fa9d4

Please sign in to comment.