handler.ts
This file
Path
src/utils/handler.ts
10 lines · 441 bytes · TypeScript
Last changed by
refactor(ssg): filter SSG Route (#2181)watanybefore adoption06fcf68
History of this fileTake it
refactor(ssg): filter SSG Route (#2181)watanybefore adoption06fcf68
lines 1–10why, one step back1import { COMPOSED_HANDLER } from '../hono-base'23export const isMiddleware = (handler: Function) => handler.length > 14export const findTargetHandler = (handler: Function): Function => {5 // eslint-disable-next-line @typescript-eslint/no-explicit-any6 return (handler as any)[COMPOSED_HANDLER]7 ? // eslint-disable-next-line @typescript-eslint/no-explicit-any8 findTargetHandler((handler as any)[COMPOSED_HANDLER])9 : handler10}