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

postal

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postal - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

2

package.json
{
"name" : "postal",
"description" : "Pub/Sub library providing wildcard subscriptions, complex message handling, etc. Works server and client-side.",
"version" : "0.6.1",
"version" : "0.6.2",
"homepage" : "http://github.com/ifandelse/postal.js",

@@ -6,0 +6,0 @@ "repository" : {

@@ -5,3 +5,3 @@ /*

License: Dual licensed MIT (http://www.opensource.org/licenses/mit-license) & GPL (http://www.opensource.org/licenses/gpl-license)
Version 0.6.1
Version 0.6.2
*/

@@ -196,2 +196,3 @@

this.priority = priority;
postal.configuration.bus.changePriority( this );
return this;

@@ -254,2 +255,20 @@ },

changePriority: function ( subDef ) {
var idx, found;
if(this.subscriptions[subDef.channel] && this.subscriptions[subDef.channel][subDef.topic]) {
this.subscriptions[subDef.channel][subDef.topic] = _.without(this.subscriptions[subDef.channel][subDef.topic], subDef);
idx = this.subscriptions[subDef.channel][subDef.topic].length - 1;
for ( ; idx >= 0; idx-- ) {
if ( this.subscriptions[subDef.channel][subDef.topic][idx].priority <= subDef.priority ) {
this.subscriptions[subDef.channel][subDef.topic].splice( idx + 1, 0, subDef );
found = true;
break;
}
}
if ( !found ) {
this.subscriptions[subDef.channel][subDef.topic].unshift( subDef );
}
}
},
publish : function ( envelope ) {

@@ -299,14 +318,3 @@ _.each( this.wireTaps, function ( tap ) {

}
idx = subs.length - 1;
for ( ; idx >= 0; idx-- ) {
if ( subs[idx].priority <= subDef.priority ) {
subs.splice( idx + 1, 0, subDef );
found = true;
break;
}
}
if ( !found ) {
subs.unshift( subDef );
}
subs.push( subDef );
return subDef;

@@ -313,0 +321,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