Socket
Socket
Sign inDemoInstall

sturdy-websocket

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sturdy-websocket - npm Package Compare versions

Comparing version 0.1.11 to 0.1.12

12

dist/index.d.ts

@@ -23,8 +23,8 @@ export interface Options {

static readonly CLOSED = 3;
onclose: (event: CloseEvent) => void;
onerror: (event: Event) => void;
onmessage: (event: MessageEvent) => void;
onopen: (event: Event) => void;
ondown: (event: CloseEvent) => void;
onreopen: (event: Event) => void;
onclose: ((event: CloseEvent) => void) | null;
onerror: ((event: Event) => void) | null;
onmessage: ((event: MessageEvent) => void) | null;
onopen: ((event: Event) => void) | null;
ondown: ((event: CloseEvent) => void) | null;
onreopen: ((event: Event) => void) | null;
readonly CONNECTING = 0;

@@ -31,0 +31,0 @@ readonly OPEN = 1;

@@ -9,8 +9,8 @@ "use strict";

this.url = url;
this.onclose = noop;
this.onerror = noop;
this.onmessage = noop;
this.onopen = noop;
this.ondown = noop;
this.onreopen = noop;
this.onclose = null;
this.onerror = null;
this.onmessage = null;
this.onopen = null;
this.ondown = null;
this.onreopen = null;
this.CONNECTING = SturdyWebSocket.CONNECTING;

@@ -274,18 +274,30 @@ this.OPEN = SturdyWebSocket.OPEN;

case "close":
this.onclose(event);
if (this.onclose) {
this.onclose(event);
}
break;
case "error":
this.onerror(event);
if (this.onerror) {
this.onerror(event);
}
break;
case "message":
this.onmessage(event);
if (this.onmessage) {
this.onmessage(event);
}
break;
case "open":
this.onopen(event);
if (this.onopen) {
this.onopen(event);
}
break;
case "down":
this.ondown(event);
if (this.ondown) {
this.ondown(event);
}
break;
case "reopen":
this.onreopen(event);
if (this.onreopen) {
this.onreopen(event);
}
break;

@@ -336,5 +348,2 @@ }

exports.default = SturdyWebSocket;
function noop() {
return undefined;
}
function getDataByteLength(data) {

@@ -341,0 +350,0 @@ if (typeof data === "string") {

{
"name": "sturdy-websocket",
"version": "0.1.11",
"version": "0.1.12",
"description": "Tiny WebSocket wrapper that reconnects and resends failed messages.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc