File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
packages/event-handler/src/rest Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ import type {
5
5
HandlerResponse ,
6
6
HttpMethod ,
7
7
Middleware ,
8
- NextFunction ,
9
8
Path ,
10
- RequestContext ,
11
9
ValidationResult ,
12
10
} from '../types/rest.js' ;
13
11
import {
@@ -151,14 +149,8 @@ export const isAPIGatewayProxyResult = (
151
149
* // -> middleware1 end
152
150
* ```
153
151
*/
154
- export const composeMiddleware = ( middleware : Middleware [ ] ) => {
155
- return async ( {
156
- reqCtx,
157
- next,
158
- } : {
159
- reqCtx : RequestContext ;
160
- next : NextFunction ;
161
- } ) => {
152
+ export const composeMiddleware = ( middleware : Middleware [ ] ) : Middleware => {
153
+ return async ( { reqCtx, next } ) => {
162
154
let index = - 1 ;
163
155
let result : HandlerResponse | undefined ;
164
156
@@ -201,6 +193,6 @@ export const composeMiddleware = (middleware: Middleware[]) => {
201
193
} ;
202
194
203
195
await dispatch ( 0 ) ;
204
- if ( result !== undefined ) return result ;
196
+ return result ;
205
197
} ;
206
198
} ;
You can’t perform that action at this time.
0 commit comments