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

hapi

Package Overview
Dependencies
Maintainers
2
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

lib/cache/index.js

6

lib/defaults.js

@@ -137,4 +137,3 @@ /*

implementation: null,
engine: 'joi',
implementation: null, // Provide an alterntative cache implemntation with same API
options: {

@@ -144,5 +143,6 @@

address: '127.0.0.1',
engineType: 'redis'
engineType: 'redis',
rules: []
}
};

@@ -82,3 +82,3 @@ /*

var line = source.map(function (d) { return +d; }); // convert all to Number
line = line.slice(0, 4); // strip non-relevant numbers
// line = line.slice(0, 4); // strip non-relevant numbers
cpulines[cpu] = line;

@@ -170,3 +170,3 @@

ChildProcess.exec('df ' + filesystem + ' | tail -1 | awk \'{print $2 \",\" $3}\'', function (err, stdout, stderr) {
ChildProcess.exec('df -m ' + filesystem + ' | tail -1 | awk \'{print $2 \",\" $3}\'', function (err, stdout, stderr) {

@@ -173,0 +173,0 @@ if (err || stderr !== '') {

@@ -16,4 +16,4 @@ /*

var Director = require('director');
var Joi = require('joi');
var MAC = require('mac');
var Async = require('async');
var Utils = require('./utils');

@@ -106,17 +106,10 @@ var Err = require('./error');

if (this.settings.cache.engine === 'joi') {
this.cache = new Cache.Client(this.settings.cache.options);
this.cache.on('ready', function (err) {
this.cache = new Joi.Cache(this.settings.cache.options);
this.cache.on('ready', function (err) {
if (err) {
if (err) {
Utils.abort('Failed to initialize cache engine: ' + err);
}
});
}
else {
Utils.abort('Unknown cache engine: ' + this.settings.cache.engine);
}
Utils.abort('Failed to initialize cache engine: ' + err);
}
});
}

@@ -123,0 +116,0 @@ }

{
"name": "hapi",
"description": "HTTP API Server framework",
"version": "0.5.1",
"version": "0.5.2",
"author": "Eran Hammer-Lahav <eran@hueniverse.com>",

@@ -21,3 +21,3 @@ "repository": "git://github.com/walmartlabs/hapi",

"async": "0.1.18",
"director": "1.0.x",
"director": "1.1.x",
"mac": "0.x.x",

@@ -27,10 +27,8 @@ "validator": "0.x.x",

"request": "2.9.x",
"sinon": "1.3.4",
"joi":"0.x.x"
"redis":"0.x.x"
},
"devDependencies": {
"jscoverage": "0.1.0",
"mocha": "0.x.x",
"request": "2.9.100",
"should": "0.x.x"
"mocha": "1.x.x",
"should": "1.x.x",
"sinon": "1.3.4"
},

@@ -37,0 +35,0 @@ "scripts": {

@@ -1,24 +0,27 @@

// var assert = require('assert');
// var b64 = require("../lib/base64");
// var should = require("should");
var b64 = require("../lib/base64");
var should = require("should");
// describe("base64", function(){
// var source = "World of WalmartLabs",
// encoded = "V29ybGQgb2YgV2FsbWFydExhYnM=";
describe("base64", function(){
var source = "World of WalmartLabs",
encoded = "V29ybGQgb2YgV2FsbWFydExhYnM=";
// describe("#encode", function(){
// it("should encode known sample to known encoding", function(done){
// var test = b64.encode(source);
// console.log(test, encoded, test === encoded);
// test.should.equal(encoded);
// done();
// })
// })
describe("#encode", function(){
it("should encode known sample to known encoding", function(done){
var test = b64.encode(source);
test.should.equal(encoded);
done();
});
});
// describe("#decode", function(){
// it("should decode known encoding to known sample", function(done){
// b64.decode(encoded).should.equal(source);
// done();
// })
// })
// })
describe("#decode", function(){
it("should decode known encoding to known sample", function(done){
b64.decode(encoded).should.equal(source);
done();
});
});
it("should decode what it encoded", function(done){
b64.decode(b64.encode(source)).should.equal(source);
done();
});
});

@@ -1,185 +0,185 @@

// var assert = require('assert');
// var hapi = require('../lib/hapi');
// var should = require("should");
// var sinon = require("sinon");
// var utils = require("../lib/utils");
var assert = require('assert');
var hapi = require('../lib/hapi');
var should = require("should");
var sinon = require("sinon");
var utils = require("../lib/utils");
// describe("utils", function(){
// var emptyObj = {};
// var nestedObj = {
// x: 'x',
// y: 'y'
// }
// var dupsArray = [nestedObj, {z:'z'}, nestedObj];
// var reducedDupsArray = [nestedObj, {z:'z'}];
describe("utils", function(){
var emptyObj = {};
var nestedObj = {
x: 'x',
y: 'y'
}
var dupsArray = [nestedObj, {z:'z'}, nestedObj];
var reducedDupsArray = [nestedObj, {z:'z'}];
// describe("#getTimestamp", function(){
// it("should return a valid unix timestamp", function(done){
// (function(){
// var ts = utils.getTimestamp();
// ts.should.be.a('number');
// var datetime = new Date(ts);
// datetime.should.be.a('object');
// }).should.not.throw();
// done();
// })
// })
describe("#getTimestamp", function(){
it("should return a valid unix timestamp", function(done){
(function(){
var ts = utils.getTimestamp();
ts.should.be.a('number');
var datetime = new Date(ts);
(typeof datetime).should.equal('object');
}).should.not.throw();
done();
})
})
// describe("#clone", function(){
// it("should clone a nested object", function(done){
// var a = nestedObj;
// var b = utils.clone(a);
describe("#clone", function(){
it("should clone a nested object", function(done){
var a = nestedObj;
var b = utils.clone(a);
// assert.deepEqual(a, b);
// done();
// })
// })
assert.deepEqual(a, b);
done();
})
})
// describe("#merge", function(){
// it("should", function(done){
// var a = emptyObj;
// var b = nestedObj;
describe("#merge", function(){
it("should", function(done){
var a = emptyObj;
var b = nestedObj;
// var c = utils.merge(a, b);
// assert.deepEqual(a, b);
// assert.deepEqual(c, b);
// done();
// })
// })
var c = utils.merge(a, b);
assert.deepEqual(a, b);
assert.deepEqual(c, b);
done();
})
})
// describe("#unique", function(){
// it("should ensure uniqueness within array of objects based on subkey", function(done){
// var a = utils.unique(dupsArray, 'x');
// assert.deepEqual(a, reducedDupsArray);
// done();
// })
// })
describe("#unique", function(){
it("should ensure uniqueness within array of objects based on subkey", function(done){
var a = utils.unique(dupsArray, 'x');
assert.deepEqual(a, reducedDupsArray);
done();
})
})
// describe("#map", function(){
// it("should convert basic array to existential object", function(done){
// var keys = [1,2,3,4];
// var a = utils.map(keys);
// for(var i in keys){
// a[keys[i]].should.equal(true);
// }
// done();
// })
describe("#map", function(){
it("should convert basic array to existential object", function(done){
var keys = [1,2,3,4];
var a = utils.map(keys);
for(var i in keys){
a[keys[i]].should.equal(true);
}
done();
})
// it("should convert array of objects to existential object", function(done){
// var keys = [{x:1}, {x:2}, {x:3}];
// var subkey = 'x';
// var a= utils.map(keys, subkey);
// for(var i in keys){
// a[keys[i][subkey]].should.equal(true);
// }
// done();
// })
// })
it("should convert array of objects to existential object", function(done){
var keys = [{x:1}, {x:2}, {x:3}];
var subkey = 'x';
var a= utils.map(keys, subkey);
for(var i in keys){
a[keys[i][subkey]].should.equal(true);
}
done();
})
})
// // #checkEmail was removed in 78435467c133416ea03465845b32026365d79bf8
// // describe("#checkEmail", function(){
// // var validEmail = "ehammer@walmart.com",
// // invalidEmail = "ohai";
// #checkEmail was removed in 78435467c133416ea03465845b32026365d79bf8
// describe("#checkEmail", function(){
// var validEmail = "ehammer@walmart.com",
// invalidEmail = "ohai";
// // it("should return false on invalid email", function(done){
// // utils.checkEmail(invalidEmail).should.equal(false);
// // done();
// // })
// it("should return false on invalid email", function(done){
// utils.checkEmail(invalidEmail).should.equal(false);
// done();
// })
// // it("should return true on valid email", function(done){
// // utils.checkEmail(validEmail).should.equal(true);
// // done();
// // })
// // })
// it("should return true on valid email", function(done){
// utils.checkEmail(validEmail).should.equal(true);
// done();
// })
// })
// describe("#hide", function(){
// var objWithHiddenKeys = {
// location: {
// name: 'San Bruno'
// },
// company: {
// name: "@WalmartLabs"
// }
// }
describe("#hide", function(){
var objWithHiddenKeys = {
location: {
name: 'San Bruno'
},
company: {
name: "@WalmartLabs"
}
}
// it("should delete params with definition's hide set to true", function(done){
// var a = utils.hide(objWithHiddenKeys, {location: {hide: true}});
// should.not.exist(objWithHiddenKeys.location);
// should.exist(objWithHiddenKeys.company);
// done();
// })
// })
it("should delete params with definition's hide set to true", function(done){
var a = utils.hide(objWithHiddenKeys, {location: {hide: true}});
should.not.exist(objWithHiddenKeys.location);
should.exist(objWithHiddenKeys.company);
done();
})
})
// describe("#getRandomString", function(){
// it('should return a random string of length 10 by default', function(done){
// var a = utils.getRandomString()
// a.length.should.equal(10);
// done();
// })
describe("#getRandomString", function(){
it('should return a random string of length 10 by default', function(done){
var a = utils.getRandomString()
a.length.should.equal(10);
done();
})
// it('should return random string of length n for any given n', function(done){
// var nArray = [1,2,3,4,6,8,12,20,30];
// for(var index in nArray){
// var n = nArray[index];
// var o = utils.getRandomString(n);
// o.length.should.equal(n);
// }
// done();
// })
it('should return random string of length n for any given n', function(done){
var nArray = [1,2,3,4,6,8,12,20,30];
for(var index in nArray){
var n = nArray[index];
var o = utils.getRandomString(n);
o.length.should.equal(n);
}
done();
})
// it('should return null if negative size given', function(done){
// var a = utils.getRandomString(-10);
// should.not.exist(a);
// done();
// })
it('should return null if negative size given', function(done){
var a = utils.getRandomString(-10);
should.not.exist(a);
done();
})
// it('should return null if non-numeric size given', function(done){
// var sizes = ['a', [1,2,3], {x:1}, 1.45];
// for(var i in sizes){
// var size = sizes[i];
// should.not.exist(utils.getRandomString(size));
// }
// done();
// })
// })
it('should return null if non-numeric size given', function(done){
var sizes = ['a', [1,2,3], {x:1}, 1.45];
for(var i in sizes){
var size = sizes[i];
should.not.exist(utils.getRandomString(size));
}
done();
})
})
// describe("#encrypt", function(){
// // Non-deterministic function, test TBD
// })
describe("#encrypt", function(){
// Non-deterministic function, test TBD
})
// describe("#decrypt", function(){
// // Non-deterministic function, test TBD
// })
describe("#decrypt", function(){
// Non-deterministic function, test TBD
})
// // #exists was removed in 78435467c133416ea03465845b32026365d79bf8
// // describe("#exists", function(){
// // it("should return true for non null, non undefined values", function(done){
// // var values = [true, 1, "one", [1], {x:1}, function(){ return 1; }];
// // for(var i in values){
// // utils.exists(values[i]).should.equal(true);
// // }
// // done();
// // })
// // })
// #exists was removed in 78435467c133416ea03465845b32026365d79bf8
// describe("#exists", function(){
// it("should return true for non null, non undefined values", function(done){
// var values = [true, 1, "one", [1], {x:1}, function(){ return 1; }];
// for(var i in values){
// utils.exists(values[i]).should.equal(true);
// }
// done();
// })
// })
// describe("#email", function(){
// // Function generates side effect, not sure if good to email on EVERY test run
// // it("should", function(done){
// // hapi.Process.initialize({
// // name: "ohai",
// // email: {
// // admin: "thegoleffect@gmail.com",
// // fromName: "Van",
// // replyTo: "thegoleffect@gmail.com",
// // server: "localhost"
// // }
// // })
describe("#email", function(){
// Function generates side effect, not sure if good to email on EVERY test run
// it("should", function(done){
// hapi.Process.initialize({
// name: "ohai",
// email: {
// admin: "thegoleffect@gmail.com",
// fromName: "Van",
// replyTo: "thegoleffect@gmail.com",
// server: "localhost"
// }
// })
// // utils.email('thegoleffect@gmail.com', 'test', 'ohai', null, function(){
// // console.log('sent')
// // done();
// // })
// // })
// utils.email('thegoleffect@gmail.com', 'test', 'ohai', null, function(){
// console.log('sent')
// done();
// })
// })
// })
// })
})
})

Sorry, the diff of this file is not supported yet

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