You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the issue has not already been raised
Issue
Hi folks,
Looking at typings for fastify reply decorations added by this library in httpError.d.ts
// Line 103exporttypeHttpErrorReplys={getHttpError: (code: HttpErrorCodes,message?: string)=>void;}&Record<HttpErrorNames,(msg?: string)=>void>;
it looks like that those functions (rep.internalServerError('') for example) should return void.
However, looking at the implementation in index.js
// Line 47fastify.decorateReply(httpError,function(message){this.send(httpErrors[httpError](message))returnthis})
it looks like that the reply object is returned after calling send function.
Could it be possible to align the typings so I can do the following in my code without a 'await' has no effect on the type of this expression.ts(80007) message and ESLint being mad?
I'll try if I got some spare time. About tests, what kind of tests you would? Just ensuring the functions actually return the reply object and not void?
Prerequisites
Issue
Hi folks,
Looking at typings for fastify reply decorations added by this library in
httpError.d.ts
it looks like that those functions (
rep.internalServerError('')
for example) should returnvoid
.However, looking at the implementation in
index.js
it looks like that the reply object is returned after calling
send
function.Could it be possible to align the typings so I can do the following in my code without a
'await' has no effect on the type of this expression.ts(80007)
message and ESLint being mad?Thanks
The text was updated successfully, but these errors were encountered: