fix(context): fix type error (#489)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Yusuke Wada · committed by GitHub · parent a4f47d1 · Browse files · 4 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
4 files+6 added−6 removed
- other:+6 added−6 removed
Provenance
- Commit
c091517- Tree
f90bd3f- Author
Yusuke Wada <yusuke@kamawada.com>- Committer
GitHub <noreply@github.com>- Parent
a4f47d1
4 files changed+6 added−6 removed
modified:deno_dist/context.ts+2 added-2 removed
7 unmodified lines89101112121314151650 unmodified lines67686970717172737475116 unmodified linesExpand all7 unmodified linesexport type Data = string | ArrayBuffer | ReadableStream
export interface Context< RequestParamKeyType extends string = string, E extends Partial<Environment> = Environment E extends Partial<Environment> = any> { req: Request<RequestParamKeyType> env: E['Bindings'] event: FetchEvent50 unmodified lines notFoundHandler: NotFoundHandler = () => new Response() ) { this._executionCtx = executionCtx this.req = req this.env = env ? env : ({} as Bindings) this.env = env || ({} as Bindings)
this.notFoundHandler = notFoundHandler this.finalized = false }116 unmodified linesExpand allmodified:deno_dist/hono.ts+1 added-1 removed
82 unmodified lines83 handler: Handler<string, E>84 }85 86 export class Hono<87- E extends { Bindings?: Bindings; Variables?: Variables } = Environment,87+ E extends Partial<Environment> = Environment,88 P extends string = '/'89 > extends defineDynamicClass()<E, P, Hono<E, P>> {90 readonly router: Router<Handler<string, E>> = new TrieRouter()91 readonly strict: boolean = true // strict routing - default is true150 unmodified linesmodified:src/context.ts+2 added-2 removed
7 unmodified lines8 export type Data = string | ArrayBuffer | ReadableStream9 10 export interface Context<11 RequestParamKeyType extends string = string,12- E extends Partial<Environment> = Environment12+ E extends Partial<Environment> = any13 > {14 req: Request<RequestParamKeyType>15 env: E['Bindings']16 event: FetchEvent50 unmodified lines67 notFoundHandler: NotFoundHandler = () => new Response()68 ) {69 this._executionCtx = executionCtx70 this.req = req71- this.env = env ? env : ({} as Bindings)71+ this.env = env || ({} as Bindings)72 73 this.notFoundHandler = notFoundHandler74 this.finalized = false75 }116 unmodified linesmodified:src/hono.ts+1 added-1 removed
82 unmodified lines83 handler: Handler<string, E>84 }85 86 export class Hono<87- E extends { Bindings?: Bindings; Variables?: Variables } = Environment,87+ E extends Partial<Environment> = Environment,88 P extends string = '/'89 > extends defineDynamicClass()<E, P, Hono<E, P>> {90 readonly router: Router<Handler<string, E>> = new TrieRouter()91 readonly strict: boolean = true // strict routing - default is true150 unmodified lines