harcon-radiation
Advanced tools
Comparing version 1.0.2 to 1.0.5
@@ -6,3 +6,5 @@ var ES6 = require('./ES6Fixer'); | ||
var VERSION = exports.VERSION = '1.0.2'; | ||
var _ = require('lodash'); | ||
var VERSION = exports.VERSION = '1.0.5'; | ||
function extend(obj, extension){ | ||
@@ -15,8 +17,2 @@ for(var key in extension){ | ||
} | ||
function isFunction(value) { | ||
return typeof value === 'function' || false; | ||
} | ||
function isString(obj) { | ||
return toString.call(obj) === '[object String]'; | ||
} | ||
@@ -165,6 +161,7 @@ function Radiation( inflicter, options ){ | ||
security.options = true; | ||
path.protector = security.protector ? ( isFunction(security.protector) ? security.protector : security.protector[service] ) : null; | ||
path.protector = security.protector ? ( _.isFunction(security.protector) ? security.protector : security.protector[service] ) : null; | ||
self.restify.post( path, function( request, content, callback ){ | ||
var params = content.params || content.parameters || []; | ||
self.ignite( clerobee.generate(), { request: request, content: content }, firestarter.division, prefix + '.' + service, params, callback ); | ||
var newRequest = _.pick(request, 'headers', 'url', 'method', 'originalUrl', 'body', 'query', 'params'); | ||
self.ignite( clerobee.generate(), { request: newRequest, content: content }, firestarter.division, prefix + '.' + service, params, callback ); | ||
}, null, security ); | ||
@@ -229,3 +226,3 @@ return path; | ||
socket.on('ignite', function( data ){ | ||
if( isString(data) ) | ||
if( _.isString(data) ) | ||
data = JSON.parse( data ); | ||
@@ -232,0 +229,0 @@ if( data && data.event ){ |
{ | ||
"name": "harcon-radiation", | ||
"version": "1.0.2", | ||
"version": "1.0.5", | ||
"description": "REST and Websocket plugin for harcon", | ||
@@ -34,2 +34,3 @@ "keywords": [ | ||
"harcon": "~2", | ||
"lodash": "^3.9.3", | ||
"socket.io": "~1" | ||
@@ -55,3 +56,3 @@ }, | ||
}, | ||
"_id": "harcon-radiation@1.0.2" | ||
"_id": "harcon-radiation@1.0.5" | ||
} |
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
31274
5
478
+ Addedlodash@^3.9.3