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
Ensure websocket handler types are only applied to websocket handlers (#68)
This corrects an issue introduced in #64 where upon adding `fastify-websocket` to a project all route handlers were (accidentally) assumed to be websocket handlers getting the different (and decidedly less useful) types. My bad! This corrects the issue by using a type-land overload of the RouteShorthand function definition to change the type of the handler only if the handler is in fact `{ websocket: true }`.
Also adds tests, `tsd` is handy!
Co-authored-by: Matteo Collina <[email protected]>
opts: RouteShorthandOptions<RawServer,RawRequest,RawReply,RequestGeneric,ContextConfig>&{websocket: true},// this creates an overload that only applies these different types if the handler is for websockets
0 commit comments