@tomphttp/bare-client
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -16,3 +16,3 @@ import type { BareHeaders, BareManifest, BareResponseFetch, urlLike } from './BareTypes'; | ||
*/ | ||
headers: BareWebSocket.HeadersProvider; | ||
headers?: BareWebSocket.HeadersProvider; | ||
/** | ||
@@ -38,3 +38,3 @@ * A hook executed by this function with helper arguments for hooking the readyState property. If a hook isn't provided, bare-client will hook the property on the instance. Hooking it on an instance basis is good for small projects, but ideally the class should be hooked by the user of bare-client. | ||
setCookiesCallback?: ((setCookies: string[]) => void) | undefined; | ||
webSocketImpl: WebSocketImpl; | ||
webSocketImpl?: WebSocketImpl; | ||
} | ||
@@ -41,0 +41,0 @@ } |
@@ -737,3 +737,5 @@ // The user likely has overwritten all networking functions after importing bare-client | ||
// we have to hook .send ourselves | ||
socket.send = function (data) { | ||
// use ...args to avoid giving the number of args a quantity | ||
// no arguments will trip the following error: TypeError: Failed to execute 'send' on 'WebSocket': 1 argument required, but only 0 present. | ||
socket.send = function (...args) { | ||
const error = getSendError(); | ||
@@ -743,3 +745,3 @@ if (error) | ||
else | ||
WebSocketFields.prototype.send.call(this, data); | ||
WebSocketFields.prototype.send.call(this, ...args); | ||
}; | ||
@@ -746,0 +748,0 @@ } |
{ | ||
"name": "@tomphttp/bare-client", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"homepage": "https://github.com/tomphttp", | ||
@@ -5,0 +5,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
215616
1887