0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-21 10:08:58 +01:00

fix(hono-base): remove .matchRoute and reduce bundle size (#3595)

This commit is contained in:
EdamAmex 2024-10-31 15:25:04 +09:00 committed by GitHub
parent fea5947ea2
commit 7183bbe41a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -382,10 +382,6 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
this.routes.push(r)
}
private matchRoute(method: string, path: string) {
return this.router.match(method, path)
}
private handleError(err: unknown, c: Context<E>) {
if (err instanceof Error) {
return this.errorHandler(err, c)
@ -406,7 +402,7 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
}
const path = this.getPath(request, { env })
const matchResult = this.matchRoute(method, path)
const matchResult = this.router.match(method, path)
const c = new Context(request, {
path,