Skip to content
Myr

refactor(hono-base): make 2nd arg of `app.route()` required (#2945)

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 e727879 · Browse files · 2 files+2 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+2 added−6 removed

  • tests:+1 added−0 removed
  • other:+1 added−6 removed

2 files+2 added−6 removed

modified:src/hono-base.ts+1 added-6 removed
213 unmodified lines
214 SubSchema extends Schema,215 SubBasePath extends string216 >(217 path: SubPath,218 app?: Hono<SubEnv, SubSchema, SubBasePath>218 app: Hono<SubEnv, SubSchema, SubBasePath>219 ): Hono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath> {220 const subApp = this.basePath(path)221222 if (!app) {223 return subApp224 }225221 app.routes.map((r) => {222 let handler223 if (app.errorHandler === errorHandler) {224 handler = r.handler
301 unmodified lines
modified:src/hono.test.ts+1 added
3501 unmodified lines
3502describe('Compatible with extended Hono classes, such Zod OpenAPI Hono.', () => {3503 class ExtendedHono extends Hono {3504 // @ts-ignore3505 route(path: string, app?: Hono) {3506 // @ts-ignore3507 super.route(path, app)3508 return this3509 }3510 // @ts-ignore
14 unmodified lines