catbox-redis
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -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(':'); | ||
}; |
{ | ||
"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 @@ |
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
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
34880
895