Comparing version 1.0.3 to 1.0.4
@@ -8,7 +8,7 @@ var Communication = require('../lib/Communication'); | ||
var VERSION = exports.VERSION = '1.0.3'; | ||
var VERSION = exports.VERSION = '1.0.4'; | ||
var _ = require('lodash'); | ||
function purify( obj, config, level ) { | ||
function purify( obj, config, level, path ) { | ||
if(!obj) return obj; | ||
@@ -22,3 +22,5 @@ if( _.isDate(obj) || _.isBoolean(obj) || _.isNumber(obj) || _.isString(obj) || _.isRegExp(obj) ) | ||
obj.forEach( function( element ){ | ||
arr.push( arr.length > config.arrayMaxSize ? '...' : purify( element, config, level+1 ) ); | ||
if( path.contains( element ) ) return; | ||
path.push( element ); | ||
arr.push( arr.length > config.arrayMaxSize ? '...' : purify( element, config, level+1, path ) ); | ||
} ); | ||
@@ -30,4 +32,7 @@ return arr; | ||
for(var key in obj) | ||
if( key && obj[key] ) | ||
res[key] = level > config.maxLevel ? '...' : purify( obj[key], config, level+1 ); | ||
if( key && obj[key] ){ | ||
if( path.contains( obj[key] ) ) continue; | ||
path.push( obj[key] ); | ||
res[key] = level > config.maxLevel ? '...' : purify( obj[key], config, level+1, path ); | ||
} | ||
return res; | ||
@@ -75,3 +80,3 @@ } | ||
self.logger.harconlog = function( err, message, obj, level ){ | ||
this.log( err ? 'error' : (level || 'debug'), err ? err.message : message, extend( purify(obj || {}, self.purifyConfig, 0), { 'harcon': VERSION } ) ); | ||
this.log( err ? 'error' : (level || 'debug'), err ? err.message : message, extend( purify(obj || {}, self.purifyConfig, 0, []), { 'harcon': VERSION } ) ); | ||
}.bind( self.logger ); | ||
@@ -78,0 +83,0 @@ |
{ | ||
"name": "harcon", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Messaging/Service Bus for the harmonic convergence of node-based enterprise entities.", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
}, | ||
"_id": "harcon@1.0.3" | ||
"_id": "harcon@1.0.4" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
969826
16748