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

eidetic

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eidetic - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

lib/eidetic.js

@@ -65,3 +65,3 @@ module.exports = function Cache(options) {

hits++;
return cachedItems[key].value;
return clone(cachedItems[key].value);
}

@@ -68,0 +68,0 @@ logger.log('Cache miss!');

@@ -7,3 +7,3 @@ {

],
"version": "0.3.0",
"version": "0.3.1",
"dependencies": {

@@ -10,0 +10,0 @@ "clone": "0.2.x"

@@ -71,2 +71,14 @@ var assert = require('assert'),

it('should not allow the cached value to be modified after a get', function(done) {
cache = new Cache();
cache.put('key', testValue);
var value = cache.get('key');
value.fnord = 'hacky';
assert.deepEqual(cache.get('key'), testValue, 'The cached value should be equal to the test value');
done();
});
it('should get the cached value after the original expiration when using a sliding expiration', function(done) {

@@ -219,2 +231,17 @@

it('should not allow the cached value to be modify after the insert', function(done) {
var valueToCache = { some: 'object' };
cache = new Cache();
cache.put('key', testValue, valueToCache);
valueToCache.some = 'fake';
var value = cache.get('key');
assert.notDeepEqual(value, valueToCache, 'the cached value should be the same as the value at the time of insert');
done();
});
it('cached value should be removed after expiration', function(done) {

@@ -244,3 +271,2 @@

var value = cache.get('key');
console.log(value);
assert.strictEqual(value, undefined, 'the cached value should be removed after expiration');

@@ -247,0 +273,0 @@ done();

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