Skip to content
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

[TS] socket.send / socket.write arguments #645

Closed
SonahtQ opened this issue May 21, 2022 · 1 comment
Closed

[TS] socket.send / socket.write arguments #645

SonahtQ opened this issue May 21, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@SonahtQ
Copy link

SonahtQ commented May 21, 2022

Describe the bug
Recently engine.io got whole new typescript code, but there are places that need for fixes.
One of it are arguments in Socket methods send and write.

send(data: any, options: any, callback?: any): this

As You can see argument options isn't optional, even that in method's body code suggets that it is: options = options || {}

A lot of projects sends data just by using socket.send(data), without any additional options, but now typescript shows error on these lines.

Engine.IO server version: 6.2.0

Solution
All we need is change options argument to be optional in methods send & write for Socket class.

@SonahtQ SonahtQ added the bug Something isn't working label May 21, 2022
darrachequesne added a commit that referenced this issue Dec 5, 2022
@darrachequesne
Copy link
Member

Added in 6d87a40. Thanks for the heads-up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants