New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hapi-methods

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-methods - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

8

index.js

@@ -11,6 +11,6 @@ var _ = require('underscore'),

}
server.method(v, function(){ /* (arg1, ...., argN, request, callback) */
var request = arguments[arguments.length-2];
request.log(["cachemiss"], { method: v });
request.log(["cachemiss"], { method: v });

@@ -23,5 +23,7 @@ var args = _.take(arguments, arguments.length-2);

generateKey: function() {
var request = arguments[arguments.length-2];
var args = _.take(arguments, arguments.length-2);
var key = sha(JSON.stringify(args));
server.log(["key-generate"], JSON.stringify(args) + " => " + key);
request.log(["key-generate"], { args: args, key: key });
return key;

@@ -28,0 +30,0 @@ }

{
"name": "hapi-methods",
"version": "2.1.0",
"version": "2.1.1",
"description": "server method helper",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,5 +14,2 @@ var should = require('should'),

ms.push({ m: m, c: c });
},
log: function(t, v){
serverlogs.push(v);
}

@@ -35,3 +32,3 @@ },

});
it('should throw an error when the method signature is invalid', function(){

@@ -60,8 +57,7 @@ helper.register.bind(null, server, cache, { myMethod: function(){} }).should.throw();

it('should log the key and args when invoked', function(){
it('should log the key and args when generating cache key', function(){
ms[0].c.generateKey(2, 2, request, function(err, res){});
var bits = serverlogs[0].split(" => ");
bits[1].should.eql('251a8ad2b3294251a16936bf66f9bc747b5e9fb3');
bits[0].should.eql(JSON.stringify([2, 2]));
logs[1].key.should.eql('251a8ad2b3294251a16936bf66f9bc747b5e9fb3');
logs[1].args.should.eql([2, 2]);
});
});
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