Skip to content

Commit 2e19e48

Browse files
committed
refactor: export exampleStrategy with handler
1 parent 008fe38 commit 2e19e48

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/core/definer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ function defineRoute<
132132
security: input.security,
133133
};
134134

135+
handler.exampleStrategy = input.exampleStrategy;
136+
135137
if (input.middleware) {
136138
return { [input.method]: input.middleware(handler) } as RouteHandler<M, PPI, MwReq, MwRes>;
137139
}

src/types/next.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ExampleStrategy } from "./example";
12
import type { HttpMethod } from "./http";
23
import type { OperationObject } from "@omer-x/openapi-types/operation";
34

@@ -10,6 +11,7 @@ export type RouteMethodHandler<PathParamsInput, Req, Res> = ((
1011
context?: RouteHandlerContext<PathParamsInput>
1112
) => Promise<Res>) & {
1213
apiData?: OperationObject,
14+
exampleStrategy?: ExampleStrategy,
1315
};
1416

1517
export type RouteHandler<

0 commit comments

Comments
 (0)