🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

catbox-redis

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

catbox-redis - npm Package Compare versions

Comparing version

to
1.1.0

11

lib/index.js

@@ -199,3 +199,12 @@

return encodeURIComponent(this.settings.partition) + ':' + encodeURIComponent(key.segment) + ':' + encodeURIComponent(key.id);
const parts = [];
if (this.settings.partition) {
parts.push(encodeURIComponent(this.settings.partition));
}
parts.push(encodeURIComponent(key.segment));
parts.push(encodeURIComponent(key.id));
return parts.join(':');
};

2

package.json
{
"name": "catbox-redis",
"description": "Redis adapter for catbox",
"version": "1.0.9",
"version": "1.1.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "contributors": [

@@ -916,2 +916,37 @@

describe('generateKey()', () => {
it('generates the storage key from a given catbox key', (done) => {
const options = {
partition: 'foo'
};
const redis = new Redis(options);
const key = {
id: 'bar',
segment: 'baz'
};
expect(redis.generateKey(key)).to.equal('foo:baz:bar');
done();
});
it('generates the storage key from a given catbox key without partition', (done) => {
const options = {};
const redis = new Redis(options);
const key = {
id: 'bar',
segment: 'baz'
};
expect(redis.generateKey(key)).to.equal('baz:bar');
done();
});
});
describe('stop()', () => {

@@ -918,0 +953,0 @@