Socket
Socket
Sign inDemoInstall

pigod

Package Overview
Dependencies
139
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

2

index.js

@@ -8,3 +8,3 @@ (() => {

ros = require('./services/remote-operations-service'),
bos = require('./services/basic-operations-service')
bos = require('./services/basic-operations-service');

@@ -11,0 +11,0 @@ // Virtual Directory Object Service

{
"name": "pigod",
"version": "1.0.0",
"version": "1.0.1",
"description": "Raspberry Pi Interaface Over LAN. Working Fork of FSGOD",

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

@@ -26,6 +26,29 @@ (() => {

function EventObject($ev, action) {
var allow = true;
this.id = uuidv4();
this.ev = $ev;
this.execute = () => {
if (allow) action();
}
this.start = () => {
allow = true;
}
this.stop = () => {
allow = false;
}
this.delete = () => {
for (var i = 0; i < events[$ev.split('-')[0]][$ev.split('-')[1]].length; i++) {
if (events[$ev.split('-')[0]][$ev.split('-')[1]][i].id == this.id) {
events[$ev.split('-')[0]][$ev.split('-')[1]].splice(i, 1);
break;
}
}
}
}
function exeEvents($ev){
var eventList = events[$ev.split('-')[0]][$ev.split('-')[1]];
for (var i = 0;i < eventList.length; i++){
eventList[i]();
eventList[i].execute();
}

@@ -39,6 +62,8 @@ }

ros.setEvent = ($ev, $val) => {
var eventList = events[$ev.split('-')[0]][$ev.split('-')[1]]
ros.event = ($ev, $val) => {
var eventList = events[$ev.split('-')[0]][$ev.split('-')[1]];
if (typeof $val === 'function'){
eventList.push($val);
var event = new EventObject($ev, $val);
eventList.push(event);
return event;
} else throw 'The second argument of setEvent takes a function only!'

@@ -134,2 +159,5 @@ }

exeConnEvents();
ros.connections[address].setOnDeviceHealth(() => {
exeConnEvents();
})
};

@@ -707,5 +735,5 @@

var getProcStatus = setInterval(getProcStatus, 500);
var getProcStatusInt = setInterval(() => { getProcStatus(); }, 500);
}
})();
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc