New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

base-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

base-websocket - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

package.json
{
"name": "base-websocket",
"version": "1.0.7",
"version": "1.0.8",
"description": "webSocket basic module",

@@ -5,0 +5,0 @@ "license": "MIT",

let a = () => {
}, i = () => {
}, s = !1;
function f({ url: n, onOpen: t, onResponse: l, onError: c, onClose: r }) {
if (s)
}, r = () => {
}, n = !1;
function S({
url: t,
onOpen: c = function() {
},
onResponse: l = function() {
},
onError: i = function() {
},
onClose: f = function() {
}
}) {
if (n)
return;
s = !0;
const e = new WebSocket(n);
n = !0;
const e = new WebSocket(t);
a = (o) => {
e.send(JSON.stringify(o));
}, i = () => {
console.log("WS CLOSE"), r(), e.close(), s = !1;
}, r = () => {
console.log("WS CLOSE"), f(), e.close(), n = !1;
}, e.onopen = () => {
t();
c();
}, e.onmessage = async (o) => {
JSON.parse(await new Response(o.data).text()) && l();
console.log(o);
const s = JSON.parse(await new Response(o.data).text());
s && l(s);
}, e.onerror = (o) => {
console.log("ERROR: ", o), s = !1, e.close(), c();
console.log("ERROR: ", o), n = !1, e.close(), i();
}, e.onclose = () => {

@@ -24,5 +36,5 @@ console.log("CLOSE");

export {
i as closeWS,
f as initWebSocket,
r as closeWS,
S as initWebSocket,
a as send
};
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