From d6fa9d4cc01301fd1da2bb351e2ecf909d731ecd Mon Sep 17 00:00:00 2001 From: Mohammed Taha <62352949+6km@users.noreply.github.com> Date: Mon, 27 May 2024 17:51:39 +0300 Subject: [PATCH] refactor(pretty-json): remove useless condition (#2815) --- src/middleware/pretty-json/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()