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

pubsubr

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubsubr - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

20

lib/client.js

@@ -13,2 +13,3 @@ const connect = require('./connect');

this.map = {};
this.times = {};
this.connect.on('message', (topic, message) => {

@@ -22,5 +23,24 @@ const payload = utils.decodeTopic(topic);

keys.forEach((item) => {
// record the topic last time
this.times[item] = new Date();
this.map[item](null, payload);
})
});
this.connect.on('reconnect', () => {
if (this.apiUrl) {
const timesKeys = Object.keys(this.times);
timesKeys.forEach((item) => {
let where = utils.decodeTopic(item);
const keys = Object.keys(where);
keys.forEach((key) => {
if (where[key] === '+' || where[key] === '#') {
delete where[key];
}
});
where = _.assign(where, {updatedAt: {gt: this.times[item]}});
this.map[item] && request.reassembly(this.apiUrl, where, this.map[item]);
})
}
});
}

@@ -27,0 +47,0 @@

2

package.json
{
"name": "pubsubr",
"version": "0.1.3",
"version": "0.1.4",
"description": "pub and sub to loopback components",

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

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