Skip to content
Myr

perf(compose): simplify (#1701)

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

* perf(compose): simplify * denoify

authored by Yusuke Wada · committed by GitHub · parent 871cf80 · Browse files · 4 files+20 added−66 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+20 added−66 removed

  • other:+20 added−66 removed

4 files+20 added−66 removed

modified:deno_dist/compose.ts+9 added-31 removed
modified:deno_dist/hono-base.ts+1 added-2 removed
326 unmodified lines
327 const composed = compose<Context>(handlers, this.errorHandler, this.notFoundHandler)328329 return (async () => {330 try {331 const tmp = composed(c)332 const context = tmp.constructor.name === 'Promise' ? await tmp : (tmp as Context)331 const context = await composed(c)332 if (!context.finalized) {333 throw new Error(334 'Context is not finalized. You may forget returning Response object or `await next()`'335 )
49 unmodified lines
modified:src/compose.ts+9 added-31 removed
modified:src/hono-base.ts+1 added-2 removed
326 unmodified lines
327 const composed = compose<Context>(handlers, this.errorHandler, this.notFoundHandler)328329 return (async () => {330 try {331 const tmp = composed(c)332 const context = tmp.constructor.name === 'Promise' ? await tmp : (tmp as Context)331 const context = await composed(c)332 if (!context.finalized) {333 throw new Error(334 'Context is not finalized. You may forget returning Response object or `await next()`'335 )
49 unmodified lines