Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@push-rpc/websocket

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@push-rpc/websocket - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

13

dist/server.js

@@ -36,5 +36,16 @@ "use strict";

var errorHandler = function () { };
var messageReplay = [];
ws.on("message", function (e) {
if (messageReplay) {
messageReplay.push(e.toString("utf-8"));
}
});
return {
onMessage: function (h) {
return ws.on("message", function (e) {
for (var _i = 0, messageReplay_1 = messageReplay; _i < messageReplay_1.length; _i++) {
var message = messageReplay_1[_i];
h(message);
}
messageReplay = null;
ws.on("message", function (e) {
h(e.toString("utf-8"));

@@ -41,0 +52,0 @@ });

6

package.json
{
"name": "@push-rpc/websocket",
"version": "1.6.0",
"version": "1.6.1",
"main": "dist/index.js",

@@ -12,3 +12,3 @@ "types": "dist/index.d.ts",

"dependencies": {
"@push-rpc/core": "^1.6.0",
"@push-rpc/core": "^1.6.1",
"ws": "^7.2.0"

@@ -21,3 +21,3 @@ },

},
"gitHead": "193290f9397e577b92f9087b5a359126ddf7d02c"
"gitHead": "c0d75bc93b480a01668e03dc0d1d5909d06999ca"
}

@@ -38,7 +38,22 @@ import * as WebSocket from "ws"

let messageReplay = []
ws.on("message", e => {
if (messageReplay) {
messageReplay.push(e.toString("utf-8"))
}
})
return {
onMessage: h =>
onMessage: h => {
for (const message of messageReplay) {
h(message)
}
messageReplay = null
ws.on("message", e => {
h(e.toString("utf-8"))
}),
})
},
onOpen: h => ws.on("open", h),

@@ -45,0 +60,0 @@ onDisconnected: h =>

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