From aa662d3171476786ad813ed74590de8798441ce2 Mon Sep 17 00:00:00 2001 From: Samuel Kopp <62482066+boywithkeyboard@users.noreply.github.com> Date: Wed, 14 Jun 2023 02:54:28 +0200 Subject: [PATCH] perf: use `indexOf` instead of `includes` --- Exception.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Exception.ts b/Exception.ts index e35d27c..0f64f64 100644 --- a/Exception.ts +++ b/Exception.ts @@ -91,7 +91,7 @@ export class Exception { const acceptHeader = request.headers.get('accept') const json = acceptHeader - ? acceptHeader.includes('application/json') || acceptHeader.includes('*/*') + ? acceptHeader.indexOf('application/json') > -1 || acceptHeader.indexOf('*/*') > -1 : false const body = json