From b1335f9fb296cfa4b947367bbad0512c7739c5f5 Mon Sep 17 00:00:00 2001
From: Yusuke Wada <yusuke@kamawada.com>
Date: Wed, 25 Dec 2024 18:33:35 +0900
Subject: [PATCH] refactor(context): remove lint errors (#3769)

* refactor(context): remove lint errors

* remove build errros
---
 src/context.ts | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/context.ts b/src/context.ts
index f5462be29..c5aa68e77 100644
--- a/src/context.ts
+++ b/src/context.ts
@@ -752,10 +752,12 @@ export class Context<
       this.#preparedHeaders = {}
     }
     this.#preparedHeaders['content-type'] = TEXT_PLAIN
+    if (typeof arg === 'number') {
+      // @ts-expect-error `Response` due to missing some types-only keys
+      return this.#newResponse(text, arg, headers)
+    }
     // @ts-expect-error `Response` due to missing some types-only keys
-    return typeof arg === 'number'
-      ? this.#newResponse(text, arg, headers)
-      : this.#newResponse(text, arg)
+    return this.#newResponse(text, arg)
   }
 
   /**