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.0.0 to 2.0.1

6

index.js

@@ -16,5 +16,5 @@ var _ = require('underscore'),

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

@@ -21,0 +21,0 @@ });

{
"name": "hapi-methods",
"version": "2.0.0",
"version": "2.0.1",
"description": "server method helper",

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

@@ -7,8 +7,12 @@ var should = require('should'),

ms = [],
logs = [];
logs = [],
serverlogs = [];
describe('tests', function(){
var server = {
method: function(n, m){
ms.push(m);
method: function(n, m, c){
ms.push({ m: m, c: c });
},
log: function(t, v){
serverlogs.push(v);
}

@@ -33,3 +37,3 @@ },

it('should log a cachemiss', function(){
ms[0](2, 2, request, function(err, res){
ms[0].m(2, 2, request, function(err, res){
logs.length.should.eql(1);

@@ -42,2 +46,13 @@ });

});
it('should register the generateKey function', function(){
var result = ms[0].c.generateKey(2, 2, request, function(err, res){});
result.should.eql('251a8ad2b3294251a16936bf66f9bc747b5e9fb3');
});
it('should log the key and args when invoked', function(){
ms[0].c.generateKey(2, 2, request, function(err, res){});
serverlogs[0].key.should.eql('251a8ad2b3294251a16936bf66f9bc747b5e9fb3');
serverlogs[0].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