-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declare correct ws
options type
#338
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The original string | string[] seems to have been a mistake because the ws package client takes 3 arguments, of which the middle one (protocols) is the string | string[], but it is optional. When it is left out - it becomes the options object instead: https://github.com/websockets/ws/blob/c798dd4ee20efb2d7591b5659839ad05cdb3eb70/lib/websocket.js#L80 The type information is covered in jsdoc: https://github.com/websockets/ws/blob/c798dd4ee20efb2d7591b5659839ad05cdb3eb70/lib/websocket.js#L627 A more complete typing information is exposed by @types/ws, though.
dominykas
changed the title
Declare correct ws options type
Declare correct Jan 6, 2025
ws
options type
@dominykas Hey Dom, thanks for the PR. Two things:
|
🤔 this is also failing on current |
Seems there's also an unrelated test failing in node 22... |
Fixed the type issue in podium hapijs/podium#84. It looked like an innocent change, sorry for that. |
It should be fine now, also for node 23. |
Thanks! Resolved conflicts - things are now green. |
Marsup
approved these changes
Jan 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original
string | string[]
seems to have been a confusion because thews
package client takes 3 arguments, of which the middle one (protocols
) is thestring | string[]
, but it is optional. When it is left out - it becomes theoptions
object instead: https://github.com/websockets/ws/blob/c798dd4ee20efb2d7591b5659839ad05cdb3eb70/lib/websocket.js#L80The type information is covered in jsdoc: https://github.com/websockets/ws/blob/c798dd4ee20efb2d7591b5659839ad05cdb3eb70/lib/websocket.js#L627
A more complete typing information is exposed by
@types/ws
, though.Closes #337.