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) } /**