catbox-memory
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "catbox-memory", | ||
"description": "Memory adapter for catbox", | ||
"version": "1.1.0", | ||
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)", | ||
"contributors": [ | ||
"Wyatt Preul <wpreul@gmail.com> (http://jsgeek.com)" | ||
], | ||
"version": "1.1.1", | ||
"repository": "git://github.com/hapijs/catbox-memory", | ||
@@ -23,4 +19,5 @@ "main": "index", | ||
"devDependencies": { | ||
"catbox": "3.x.x", | ||
"lab": "4.x.x" | ||
"catbox": "4.x.x", | ||
"lab": "5.x.x", | ||
"code": "1.x.x" | ||
}, | ||
@@ -27,0 +24,0 @@ "scripts": { |
@@ -8,3 +8,3 @@ catbox-memory | ||
Current version: **1.0.x** [![Build Status](https://api.travis-ci.org/hapijs/catbox-memory.svg)](https://travis-ci.org/hapijs/catbox-memory) | ||
Current version: [![Current Version](https://img.shields.io/npm/v/catbox-memory.svg)](https://www.npmjs.org/package/catbox-memory) [![Build Status](https://api.travis-ci.org/hapijs/catbox-memory.svg)](https://travis-ci.org/hapijs/catbox-memory) | ||
@@ -11,0 +11,0 @@ ### Options |
// Load modules | ||
var Code = require('code'); | ||
var Lab = require('lab'); | ||
@@ -18,5 +19,3 @@ var Catbox = require('catbox'); | ||
var it = lab.it; | ||
var before = lab.before; | ||
var after = lab.after; | ||
var expect = Lab.expect; | ||
var expect = Code.expect; | ||
@@ -67,3 +66,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
@@ -90,6 +89,6 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(result.item instanceof Buffer).to.equal(true); | ||
@@ -114,6 +113,6 @@ expect(result.item).to.deep.equal(buffer); | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(result.item).to.not.equal(buffer); | ||
@@ -137,6 +136,6 @@ done(); | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(result.item instanceof Buffer).to.equal(false); | ||
@@ -158,3 +157,3 @@ expect(result.item).to.deep.equal(JSON.parse(JSON.stringify(buffer))); | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
@@ -167,3 +166,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
@@ -236,3 +235,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(client.isReady()).to.equal(true); | ||
@@ -242,3 +241,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(client.isReady()).to.equal(true); | ||
@@ -272,3 +271,3 @@ done(); | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
setTimeout(function () { | ||
@@ -334,3 +333,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
done(); | ||
@@ -348,4 +347,4 @@ }); | ||
expect(err).to.exist; | ||
expect(result).to.not.exist; | ||
expect(err).to.exist(); | ||
expect(result).to.not.exist(); | ||
done(); | ||
@@ -362,3 +361,3 @@ }); | ||
expect(err).to.exist; | ||
expect(err).to.exist(); | ||
done(); | ||
@@ -396,3 +395,3 @@ }); | ||
describe('#start', function () { | ||
describe('start()', function () { | ||
@@ -402,6 +401,6 @@ it('creates an empty cache object', function (done) { | ||
var memory = new Memory(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
done(); | ||
@@ -412,3 +411,3 @@ }); | ||
describe('#stop', function () { | ||
describe('stop()', function () { | ||
@@ -418,8 +417,8 @@ it('sets the cache object to null', function (done) { | ||
var memory = new Memory(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.stop(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
done(); | ||
@@ -430,3 +429,3 @@ }); | ||
describe('#get', function () { | ||
describe('get()', function () { | ||
@@ -441,7 +440,7 @@ it('errors on invalid json in cache', function (done) { | ||
var memory = new Memory(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key, 'myvalue', 10, function () { | ||
@@ -468,11 +467,11 @@ | ||
var memory = new Memory(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.get(key, function (err, result) { | ||
expect(err).to.not.exist; | ||
expect(result).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(result).to.not.exist(); | ||
done(); | ||
@@ -484,3 +483,3 @@ }); | ||
describe('#set', function () { | ||
describe('set()', function () { | ||
@@ -495,7 +494,7 @@ it('adds an item to the cache object', function (done) { | ||
var memory = new Memory(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key, 'myvalue', 10, function () { | ||
@@ -517,7 +516,7 @@ | ||
var memory = new Memory(); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key, 'myvalue', 10, function () { | ||
@@ -528,3 +527,3 @@ | ||
expect(memory.cache[key.segment][key.id]).to.not.exist; | ||
expect(memory.cache[key.segment][key.id]).to.not.exist(); | ||
done(); | ||
@@ -544,10 +543,10 @@ }, 15); | ||
var memory = new Memory({ maxByteSize: 4 }); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key, 'myvalue', 10, function (err) { | ||
expect(err).to.exist; | ||
expect(err).to.exist(); | ||
expect(err).to.be.instanceOf(Error); | ||
@@ -574,10 +573,10 @@ done(); | ||
var memory = new Memory({ maxByteSize: 200 }); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key1, 'my', 10, function (err) { | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
expect(memory.cache[key1.segment][key1.id].item).to.equal('"my"'); | ||
@@ -587,3 +586,3 @@ | ||
expect(err).to.exist; | ||
expect(err).to.exist(); | ||
done(); | ||
@@ -610,7 +609,7 @@ }); | ||
var memory = new Memory({ maxByteSize: 2000 }); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key1, itemToStore, 10, function () { | ||
@@ -620,3 +619,3 @@ | ||
expect(memory.cache[key1.segment][key1.id].byteSize).to.equal(204); | ||
expect(memory.cache[key1.segment][key1.id].item).to.exist; | ||
expect(memory.cache[key1.segment][key1.id].item).to.exist(); | ||
done(); | ||
@@ -643,15 +642,15 @@ }); | ||
var memory = new Memory({ maxByteSize: 2000 }); | ||
expect(memory.cache).to.not.exist; | ||
expect(memory.cache).to.not.exist(); | ||
memory.start(function () { | ||
expect(memory.cache).to.exist; | ||
expect(memory.cache).to.exist(); | ||
memory.set(key1, itemToStore, 10, function () { | ||
expect(memory.cache[key1.segment][key1.id].byteSize).to.equal(204); | ||
expect(memory.cache[key1.segment][key1.id].item).to.exist; | ||
expect(memory.cache[key1.segment][key1.id].item).to.exist(); | ||
memory.set(key1, itemToStore, 10, function () { | ||
expect(memory.cache[key1.segment][key1.id].byteSize).to.equal(204); | ||
expect(memory.cache[key1.segment][key1.id].item).to.exist; | ||
expect(memory.cache[key1.segment][key1.id].item).to.exist(); | ||
done(); | ||
@@ -664,3 +663,3 @@ }); | ||
describe('#drop', function () { | ||
describe('drop()', function () { | ||
@@ -675,3 +674,3 @@ it('drops an existing item', function (done) { | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
@@ -683,3 +682,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
done(); | ||
@@ -700,3 +699,3 @@ }); | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
done(); | ||
@@ -715,3 +714,3 @@ }); | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
client.get(key, function (err, result) { | ||
@@ -723,3 +722,3 @@ | ||
expect(err).to.not.exist; | ||
expect(err).to.not.exist(); | ||
done(); | ||
@@ -765,3 +764,3 @@ }); | ||
expect(err).to.exist; | ||
expect(err).to.exist(); | ||
done(); | ||
@@ -777,3 +776,3 @@ }); | ||
expect(err).to.exist; | ||
expect(err).to.exist(); | ||
done(); | ||
@@ -784,3 +783,3 @@ }); | ||
describe('#validateSegmentName', function () { | ||
describe('validateSegmentName()', function () { | ||
@@ -787,0 +786,0 @@ it('errors when the name is empty', function (done) { |
Sorry, the diff of this file is not supported yet
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
31191
0
3
715
2