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

spacebro

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spacebro - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

34

index.js

@@ -58,11 +58,25 @@ 'use strict'

var updateOtherSockets = function () {
for (let socket of io.sockets.sockets) {
var newEventList = _.difference(config.events, keyNameToArray(socket._events))
newEventList = _.difference(newEventList, defaultSocketEvent)
for (let triggerName of newEventList) {
socket.on(triggerName, function (datas) {
console.log('index.js - registered event: ' + triggerName + ' triggered with datas: ', datas)
io.emit(triggerName, datas)
})
if (Array.isArray(io.sockets.sockets)) {
for (let socket of io.sockets.sockets) {
var newEventList = _.difference(config.events, keyNameToArray(socket._events))
newEventList = _.difference(newEventList, defaultSocketEvent)
for (let triggerName of newEventList) {
socket.on(triggerName, function (datas) {
console.log('index.js - registered event: ' + triggerName + ' triggered with datas: ', datas)
io.emit(triggerName, datas)
})
}
}
} else {
let socket = io.sockets.sockets[Object.keys(io.sockets.sockets)[0]]
if (socket && socket.clientName && socket.eventsListRegistered) {
var newEventList = _.difference(config.events, keyNameToArray(socket._events))
newEventList = _.difference(newEventList, defaultSocketEvent)
for (let triggerName of newEventList) {
socket.on(triggerName, function (datas) {
console.log('index.js - registered event: ' + triggerName + ' triggered with datas: ', datas)
io.emit(triggerName, datas)
})
}
}
}

@@ -89,3 +103,3 @@ }

for (let socket of io.sockets.sockets) {
if (socket.clientName && socket.eventsListRegistered) {
if (socket && socket.clientName && socket.eventsListRegistered) {
table.push([socket.clientName, socket.eventsListRegistered, socket.connected ? 'online' : 'offline'])

@@ -96,3 +110,3 @@ }

let socket = io.sockets.sockets[Object.keys(io.sockets.sockets)[0]]
if (socket.clientName && socket.eventsListRegistered) {
if (socket && socket.clientName && socket.eventsListRegistered) {
table.push([socket.clientName, socket.eventsListRegistered, socket.connected ? 'online' : 'offline'])

@@ -99,0 +113,0 @@ }

{
"name": "spacebro",
"version": "0.1.5",
"version": "0.1.6",
"description": "Spacebro use Zeroconf and socket.io to bind apps together!",

@@ -5,0 +5,0 @@ "keywords": [

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