engine.io icon indicating copy to clipboard operation
engine.io copied to clipboard

[TS] socket.send / socket.write arguments

Open SonahtQ opened this issue 3 years ago • 0 comments

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 avatar May 21 '22 13:05 SonahtQ