diff --git a/src/AutoRouter.ts b/src/AutoRouter.ts index 04da2fa..9055226 100644 --- a/src/AutoRouter.ts +++ b/src/AutoRouter.ts @@ -24,7 +24,7 @@ export const AutoRouter = < catch: error, finally: [ // @ts-ignore - (r: any, ...args) => r ?? missing(r, ...args), + (r: any, ...args) => r ?? missing(...args), format, ...f, ], diff --git a/src/types/AutoRouterOptions.ts b/src/types/AutoRouterOptions.ts index c373ecd..adfdfb3 100644 --- a/src/types/AutoRouterOptions.ts +++ b/src/types/AutoRouterOptions.ts @@ -1,7 +1,11 @@ +import { RequestHandler } from './RequestHandler' import { ResponseHandler } from './ResponseHandler' import { RouterOptions } from './RouterOptions' -export type AutoRouterOptions = { - missing?: ResponseHandler +export type AutoRouterOptions< + RequestType, + Args extends any[], +> = { + missing?: RequestHandler format?: ResponseHandler -} & RouterOptions +} & RouterOptions \ No newline at end of file