Currently the use function allows for inputs to be either Middleware or ErrorHandlingMiddleware. However, the typescript type requires the list of arguments to be only Middleware or only ErrorHandlingMiddleware. I.e. you couldn't call api.use with both error middleware and normal middleware. This pr brings the typescript type back into line with code expectation.
Currently the use function allows for inputs to be either Middleware or ErrorHandlingMiddleware. However, the typescript type requires the list of arguments to be only Middleware or only ErrorHandlingMiddleware. I.e. you couldn't call api.use with both error middleware and normal middleware. This pr brings the typescript type back into line with code expectation.
Code Section in question: https://github.com/jeremydaly/lambda-api/blob/c1fe83e53d56eb23c4ef755c01bf1ebc07a7c342/index.js#L355-L383