engine.io
Advanced tools
Comparing version 6.3.0 to 6.3.1
@@ -6,2 +6,5 @@ /// <reference types="node" /> | ||
import { RawData } from "engine.io-parser"; | ||
export interface SendOptions { | ||
compress?: boolean; | ||
} | ||
export declare class Socket extends EventEmitter { | ||
@@ -113,5 +116,3 @@ readonly protocol: number; | ||
*/ | ||
send(data: RawData, options?: { | ||
compress: boolean; | ||
}, callback?: () => void): this; | ||
send(data: RawData, options?: SendOptions, callback?: () => void): this; | ||
/** | ||
@@ -124,5 +125,3 @@ * Alias of {@link send}. | ||
*/ | ||
write(data: RawData, options?: { | ||
compress: boolean; | ||
}, callback?: () => void): this; | ||
write(data: RawData, options?: SendOptions, callback?: () => void): this; | ||
/** | ||
@@ -129,0 +128,0 @@ * Sends a packet. |
@@ -372,12 +372,14 @@ "use strict"; | ||
*/ | ||
sendPacket(type, data, options = { compress: true }, callback) { | ||
sendPacket(type, data, options = {}, callback) { | ||
if ("function" === typeof options) { | ||
callback = options; | ||
options = null; | ||
options = {}; | ||
} | ||
if ("closing" !== this.readyState && "closed" !== this.readyState) { | ||
debug('sending packet "%s" (%s)', type, data); | ||
// compression is enabled by default | ||
options.compress = options.compress !== false; | ||
const packet = { | ||
type, | ||
options, | ||
options: options, | ||
}; | ||
@@ -384,0 +386,0 @@ if (data) |
{ | ||
"name": "engine.io", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
149723
4104