Skip to content
Myr

refactor: compose (#116)

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 be40084 · Browse files · 3 files+79 added−29 removed
This commit

State

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

Diff stats

3 files+79 added−29 removed

  • tests:+63 added−16 removed
  • other:+16 added−13 removed

3 files+79 added−29 removed

modified:src/compose.test.ts+63 added-16 removed
modified:src/compose.ts+14 added-11 removed
modified:src/hono.ts+2 added-2 removed
166 unmodified lines
167 const composed = compose<Context>(middleware, this.onError)168 const c = new Context(request, { env: env, event: event, res: null })169 c.notFound = () => this.notFound(c)170171 await composed(c)171 const context = await composed(c)172173 return c.res173 return context.res174 }175176 async handleEvent(event: FetchEvent): Promise<Response> {177 return this.dispatch(event.request, {}, event)
25 unmodified lines