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

pubsub-js

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

pubsub-js - npm Package Compare versions

Comparing version 1.9.2 to 1.9.3

11

CHANGES.md
# Changes
## 1.9.3
- [`a810919`](https://github.com/mroderick/PubSubJS/commit/a81091962dd4836da9da6dcf7aafeca4aeb9f815)
Fix countSubscriptions
>
> This was introduced in ad93491c760ebc0429a7e9072b2747b2c2ce0a0a, but had
> a bug that was not covered by unit tests.
>
_Released on 2021-02-18._
## 1.9.2

@@ -4,0 +15,0 @@

2

package.json
{
"name": "pubsub-js",
"version": "1.9.2",
"version": "1.9.3",
"description": "Dependency free publish/subscribe library",

@@ -5,0 +5,0 @@ "main": "./src/pubsub.js",

@@ -254,6 +254,11 @@ /**

var m;
// eslint-disable-next-line no-unused-vars
var token;
var count = 0;
for (m in messages){
if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0){
count++;
for (m in messages) {
if (Object.prototype.hasOwnProperty.call(messages, m) && m.indexOf(topic) === 0) {
for (token in messages[m]) {
count++;
}
break;
}

@@ -260,0 +265,0 @@ }

@@ -19,2 +19,15 @@ 'use strict';

});
it('should count all subscriptions', function() {
var topic = TestHelper.getUniqueString(),
spy1 = sinon.spy(),
spy2 = sinon.spy();
PubSub.subscribe(topic, spy1);
PubSub.subscribe(topic, spy2);
var counts = PubSub.countSubscriptions(topic);
assert.equals(counts, 2);
});
});
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