Skip to content

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

@SonahtQ

Description

@SonahtQ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions