handler.ts
This file
Path
src/utils/handler.ts
15 lines 路 480 bytes 路 TypeScript
Last changed by
Not known.
History of this fileTake it
12345678910111213141516/** * @module * Handler utility. */
import { COMPOSED_HANDLER } from './constants'
export const isMiddleware = (handler: Function) => handler.length > 1export const findTargetHandler = (handler: Function): Function => { // eslint-disable-next-line @typescript-eslint/no-explicit-any return (handler as any)[COMPOSED_HANDLER] ? // eslint-disable-next-line @typescript-eslint/no-explicit-any findTargetHandler((handler as any)[COMPOSED_HANDLER]) : handler}