Skip to content

Commit

Permalink
Updated deno_dist Deno files
Browse files Browse the repository at this point in the history
  • Loading branch information
NuroDev committed Dec 4, 2023
1 parent e9f0043 commit f261320
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deno_dist/helper/dev/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Hono } from '../../hono.ts'
import type { RouterRoute } from '../../types.ts'
import type { Env, RouterRoute } from '../../types.ts'

interface ShowRoutesOptions {
verbose?: boolean
Expand All @@ -17,7 +17,7 @@ const handlerName = (handler: Function) => {
return handler.name || (isMiddleware(handler) ? '[middleware]' : '[handler]')
}

export const inspectRoutes = (hono: Hono): RouteData[] => {
export const inspectRoutes = <TEnv extends Env>(hono: Hono<TEnv>): RouteData[] => {
return hono.routes.map(({ path, method, handler }: RouterRoute) => ({
path,
method,
Expand All @@ -26,7 +26,7 @@ export const inspectRoutes = (hono: Hono): RouteData[] => {
}))
}

export const showRoutes = (hono: Hono, opts?: ShowRoutesOptions) => {
export const showRoutes = <TEnv extends Env>(hono: Hono<TEnv>, opts?: ShowRoutesOptions) => {
const routeData: Record<string, RouteData[]> = {}
let maxMethodLength = 0
let maxPathLength = 0
Expand Down

0 comments on commit f261320

Please sign in to comment.