Skip to content
Myr

refactor(context): remove some `any` (#2658)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* refactor(context): remove some `any` * denoify

authored by Yusuke Wada · committed by GitHub · parent dd52c56 · Browse files · 2 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−6 removed

  • other:+6 added−6 removed

2 files+6 added−6 removed

modified:deno_dist/context.ts+3 added-3 removed
50 unmodified lines
51 TypedResponse<T, U, 'text'>52}5354interface JSONRespond {55 <T extends JSONValue | Simplify<any>, U extends StatusCode>(55 <T extends JSONValue | Simplify<unknown>, U extends StatusCode>(56 object: T,57 status?: U,58 headers?: HeaderRecord59 ): Response &
5 unmodified lines
65 : never,66 U,67 'json'68 >69 <T extends JSONValue | Simplify<any>, U extends StatusCode>(69 <T extends JSONValue | Simplify<unknown>, U extends StatusCode>(70 object: Simplify<T> extends JSONValue ? T : Simplify<T>,71 init?: ResponseInit72 ): Response &73 TypedResponse<
413 unmodified lines
487 * })488 * ```489 * @see https://hono.dev/api/context#json490 */491 json: JSONRespond = <T extends JSONValue | Simplify<any>, U extends StatusCode>(491 json: JSONRespond = <T extends JSONValue | Simplify<unknown>, U extends StatusCode>(492 object: T,493 arg?: U | ResponseInit,494 headers?: HeaderRecord495 ): ReturnType<JSONRespond> => {
70 unmodified lines
modified:src/context.ts+3 added-3 removed
50 unmodified lines
51 TypedResponse<T, U, 'text'>52}5354interface JSONRespond {55 <T extends JSONValue | Simplify<any>, U extends StatusCode>(55 <T extends JSONValue | Simplify<unknown>, U extends StatusCode>(56 object: T,57 status?: U,58 headers?: HeaderRecord59 ): Response &
5 unmodified lines
65 : never,66 U,67 'json'68 >69 <T extends JSONValue | Simplify<any>, U extends StatusCode>(69 <T extends JSONValue | Simplify<unknown>, U extends StatusCode>(70 object: Simplify<T> extends JSONValue ? T : Simplify<T>,71 init?: ResponseInit72 ): Response &73 TypedResponse<
413 unmodified lines
487 * })488 * ```489 * @see https://hono.dev/api/context#json490 */491 json: JSONRespond = <T extends JSONValue | Simplify<any>, U extends StatusCode>(491 json: JSONRespond = <T extends JSONValue | Simplify<unknown>, U extends StatusCode>(492 object: T,493 arg?: U | ResponseInit,494 headers?: HeaderRecord495 ): ReturnType<JSONRespond> => {
70 unmodified lines