handler.ts
This file
Path
src/utils/handler.ts
15 lines · 481 bytes · TypeScript
Last changed by
Merge pull request #2769 from honojs/nextYusuke Wadabefore adoptionacd3634
History of this fileTake it
Merge pull request #2769 from honojs/nextYusuke Wadabefore adoptionacd3634
lines 1–5why, one step back1/**2 * @module3 * Handler utility.4 */5refactor(ssg): filter SSG Route (#2181)watanybefore adoption06fcf68
lines 6–15why, one step back6import { COMPOSED_HANDLER } from '../hono-base'78export const isMiddleware = (handler: Function) => handler.length > 19export const findTargetHandler = (handler: Function): Function => {10 // eslint-disable-next-line @typescript-eslint/no-explicit-any11 return (handler as any)[COMPOSED_HANDLER]12 ? // eslint-disable-next-line @typescript-eslint/no-explicit-any13 findTargetHandler((handler as any)[COMPOSED_HANDLER])14 : handler15}