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

harcon

Package Overview
Dependencies
Maintainers
1
Versions
326
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harcon - npm Package Compare versions

Comparing version 0.9.4 to 0.9.5

22

lib/Barrel.js

@@ -13,2 +13,3 @@ var async = require('async');

this.logger = logger;
this.systemFirestarter = null;
}

@@ -27,2 +28,15 @@ var barrel = Barrel.prototype;

barrel.isSystemEvent = function( eventName ){
return this.systemFirestarter ? eventName.startsWith( this.systemFirestarter.name + '.' ) : false;
};
barrel.igniteSystemEvent = function(){
if(this.systemFirestarter){
var args = [ this.systemFirestarter.name + '.' + arguments[0] ];
for(var i=1; i<arguments.length; i+=1)
args.push( arguments[i] );
this.systemFirestarter.ignite.apply( this.systemFirestarter, args );
}
};
/**

@@ -40,2 +54,3 @@ * Deregisters a firestarter instance

this.firestarters.splice(index, 1);
this.igniteSystemEvent( 'castOf', name, fs );
fs.close();

@@ -57,2 +72,4 @@ }

this.igniteSystemEvent( 'affiliate', firestarter );
this.firestarters.push( firestarter );

@@ -92,3 +109,4 @@ return firestarter;

if( matching.length === 0 ){
// name, error, response
if( self.isSystemEvent( comm.event ) ) return;
if( comm.callback )

@@ -119,2 +137,4 @@ self.appease( comm, new Error('Nobody is listening'), null );

this.igniteSystemEvent( 'close' );
self.firestarters.forEach( function( fs ){

@@ -121,0 +141,0 @@ if( fs.close ){

75

lib/ES6Fixer.js

@@ -1,34 +0,45 @@

if( !Array.prototype.contains )
Array.prototype.contains = function( object ){
for( var i = 0; i<this.length; i+=1){
if( object === this[i] ) return true;
}
return false;
};
if( !Array.prototype.find )
Array.prototype.find = function( fn ){
for( var i = 0; i<this.length; i+=1){
if( fn(this[i], i, this) ) return this[i];
}
return null;
};
if( !Array.prototype.findIndex )
Array.prototype.findIndex = function( fn ){
for( var i = 0; i<this.length; i+=1){
if( fn(this[i], i, this) ) return i;
}
return -1;
};
if (!Array.prototype.contains)
Array.prototype.contains = function (object) {
for (var i = 0; i < this.length; i += 1) {
if (object === this[i]) return true;
}
return false;
};
if (!Array.prototype.find)
Array.prototype.find = function (fn) {
for (var i = 0; i < this.length; i += 1) {
if (fn(this[i], i, this)) return this[i];
}
return null;
};
if (!Array.prototype.findIndex)
Array.prototype.findIndex = function (fn) {
for (var i = 0; i < this.length; i += 1) {
if (fn(this[i], i, this)) return i;
}
return -1;
};
if (!String.prototype.startsWith) {
Object.defineProperty(String.prototype, 'startsWith', {
venumerable: false,
configurable: false,
writable: false,
value: function(searchString, position) {
position = position || 0;
return this.lastIndexOf(searchString, position) === position;
}
});
}
if (!String.prototype.endsWith) {
Object.defineProperty(String.prototype, 'endsWith', {
value: function (searchString, position) {
var subjectString = this.toString();
if (position === undefined || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
}
});
Object.defineProperty(String.prototype, 'endsWith', {
value: function (searchString, position) {
var subjectString = this.toString();
if (position === undefined || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
}
});
}

@@ -7,2 +7,7 @@ var Communication = require('./Communication');

var toString = Object.prototype.toString;
function isString(obj) {
return "[object String]" === toString.call(obj);
}
/**

@@ -20,2 +25,10 @@ * Firestarter is an abstract type to define a wrapper for listeners

/**
* Retrieves the array of events it is listening
*/
firestarter.getServices = function( ){
throw new Error('To be implemented...');
};
/**
* Matches the emited event with the interest of the entity encapsulated by this firestarter

@@ -123,11 +136,4 @@ *

/**
* Distpaches the new event to be emited
*
* @method ignite
* @param varargs defining attributes of a communication: eventName [list of parameters] [callback]
*/
firestarter.ignite = function( ){
firestarter.simpleIgnite = function( ){
var event = arguments[ 0 ];
var hasCallback = isFunction( arguments[ arguments.length-1 ] );

@@ -149,2 +155,26 @@ var params = [].slice.call(arguments, 1, hasCallback ? arguments.length-1 : arguments.length );

/**
* Distpaches the new event to be emited
*
* @method ignite
* @param varargs defining attributes of a communication: eventName [list of parameters] [callback]
*/
firestarter.ignite = function( ){
var event = arguments[ 0 ];
if( isString(event) )
return this.simpleIgnite.apply( this, arguments );
if( Array.isArray(event) ){
var hasCallback = isFunction( arguments[ arguments.length-1 ] );
if( !hasCallback ){
var ids = [];
event.forEach( function(ev){
var args = [ev].concat( arguments.slice( 1 ) );
ids.push( this.simpleIgnite.apply( this, args ) );
} );
return ids;
}
}
throw new Error( 'Invalid parameters' );
};
/**
* Distpaches the burst event to be emited within the flow of a previous event

@@ -151,0 +181,0 @@ *

@@ -44,2 +44,6 @@ var Firestarter = require('./Firestarter');

firestorm.getServices = function( ){
return this.events;
};
firestorm.matches = function( eventName ){

@@ -46,0 +50,0 @@ var index = eventName.lastIndexOf( '.' );

@@ -41,2 +41,6 @@ var Communication = require('./Communication');

flamestarter.getServices = function( ){
return [ this.event ];
};
flamestarter.innerMatches = function( eventName ){

@@ -43,0 +47,0 @@ if( this.event === '*' )

@@ -54,3 +54,3 @@ var Communication = require('../lib/Communication');

this.systemFirestarter = this.addicts( {
this.systemFirestarter = this.barrel.systemFirestarter = this.addicts( {
name: self.name,

@@ -57,0 +57,0 @@ options: self.options,

{
"name": "harcon",
"version": "0.9.4",
"version": "0.9.5",
"description": "Messaging/Service Bus for the harmonic convergence of node-based enterprise entities.",

@@ -48,3 +48,3 @@ "keywords": [

},
"_id": "harcon@0.9.4"
"_id": "harcon@0.9.5"
}
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