Huge News!Announcing our $40M Series B led by Abstract Ventures.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.3.9 to 1.3.10

version

2

bower.json
{
"name": "PubSubJS",
"version": "1.3.9",
"version": "1.3.10",
"main": "src/pubsub.js",

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

{
"name": "pubsub-js",
"version": "1.3.9",
"description": "Dependency free publish/subscribe library",
"main": "./src/pubsub.js",
"directories": {
"lib": "src",
"test": "test"
},
"scripts": {
"test": "grunt test"
},
"repository": {
"type": "git",
"url": "git://github.com/mroderick/PubSubJS.git"
},
"keywords": [
"pub/sub",
"pubsub",
"publish/subscribe",
"publish",
"subscribe"
],
"author": {
"name": "Morgan Roderick",
"email": "morgan@roderick.dk",
"url": "http://roderick.dk"
},
"license": "MIT",
"devDependencies": {
"buster": "0.6.x",
"grunt": "0.4.0",
"grunt-jslint": "0.2.5",
"grunt-buster": "0.1.2"
}
"name": "pubsub-js",
"version": "1.3.10",
"description": "Dependency free publish/subscribe library",
"main": "./src/pubsub.js",
"directories": {
"lib": "src",
"test": "test"
},
"scripts": {
"test": "grunt test"
},
"repository": {
"type": "git",
"url": "git://github.com/mroderick/PubSubJS.git"
},
"keywords": [
"pub/sub",
"pubsub",
"publish/subscribe",
"publish",
"subscribe"
],
"author": {
"name": "Morgan Roderick",
"email": "morgan@roderick.dk",
"url": "http://roderick.dk"
},
"license": "MIT",
"devDependencies": {
"buster": "0.6.x",
"grunt": "0.4.0",
"grunt-jslint": "0.2.5",
"grunt-buster": "0.1.2"
}
}

@@ -175,3 +175,3 @@ # PubSubJS

// add a subscription
var token = $.pubsub('subscribe', topic, sayHello );
var token = $.pubsub('subscribe', topic, subscriber );

@@ -178,0 +178,0 @@ // unsubscribing

@@ -21,3 +21,3 @@ /*

// CommonJS
if (typeof exports === 'object'){
if (typeof exports === 'object' && module){
module.exports = factory();

@@ -157,2 +157,6 @@

PubSub.subscribe = function( message, func ){
if ( typeof func !== 'function'){
return false;
}
// message is not registered yet

@@ -206,2 +210,2 @@ if ( !messages.hasOwnProperty( message ) ){

return PubSub;
}));
}));

@@ -6,2 +6,3 @@ /*jslint white:true, plusplus:true */

assert,
refute,
require,

@@ -73,3 +74,29 @@ sinon

// make sure all tokens are different
TestHelper.assertAllTokensDifferent( tokens );
TestHelper.assertAllTokensDifferent( tokens );
},
'should return false when subscriber argument is not a function' : function(){
var invalidSubscribers = [undefined, null, 'a string', 123, [], {}, new Date()],
topic = TestHelper.getUniqueString(),
i;
for ( i = 0; i < invalidSubscribers.length; i++ ){
assert.equals(PubSub.subscribe(topic, invalidSubscribers[i]), false);
}
assert.equals(i, invalidSubscribers.length);
},
'must not throw errors when publishing with invalid subscribers' : function(){
var invalidSubscribers = [undefined, null, 'a string', 123, [], {}, new Date()],
topic = TestHelper.getUniqueString(),
i;
for (i = 0; i < invalidSubscribers.length; i++){
PubSub.subscribe(topic, invalidSubscribers[i]);
}
refute.exception(function(){
PubSub.publish(topic, TestHelper.getUniqueString());
});
}

@@ -76,0 +103,0 @@ });

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