hapi-methods
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -1,2 +0,3 @@ | ||
var _ = require('underscore'); | ||
var _ = require('underscore'), | ||
sha = require("sha1"); | ||
@@ -14,3 +15,6 @@ exports.register = function(server, cache, methods){ | ||
generateKey: function() { | ||
return JSON.stringify(_.take(arguments, arguments.length-2)); | ||
var args = _.take(arguments, arguments.length-2); | ||
var sha = sha(JSON.stringify(args)); | ||
server.log(["key-generate"], { args: args, key: sha }); | ||
return sha; | ||
} | ||
@@ -17,0 +21,0 @@ }); |
{ | ||
"name": "hapi-methods", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "server method helper", | ||
@@ -31,4 +31,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"sha1": "^1.1.0", | ||
"underscore": "^1.6.0" | ||
} | ||
} |
@@ -37,5 +37,5 @@ var should = require('should'), | ||
it('should log a cachemiss', function(){ | ||
it('should include the method name on the log', function(){ | ||
logs[0].method.should.eql('myMethod'); | ||
}); | ||
}); |
8218
170
2
+ Addedsha1@^1.1.0
+ Addedcharenc@0.0.2(transitive)
+ Addedcrypt@0.0.2(transitive)
+ Addedsha1@1.1.1(transitive)