Comparing version 0.2.2 to 0.3.0
@@ -48,2 +48,6 @@ module.exports = function Cache(options) { | ||
this.keys = function() { | ||
return Object.keys(cachedItems); | ||
}; | ||
this.get = function(key) { | ||
@@ -50,0 +54,0 @@ logger.log('Attempting to get entry from cache under key: ' + key); |
@@ -7,5 +7,5 @@ { | ||
], | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"dependencies": { | ||
"clone": "0.1.x" | ||
"clone": "0.2.x" | ||
}, | ||
@@ -17,3 +17,2 @@ "devDependencies": { | ||
"blanket": "1.x.x", | ||
"node-dependencies": "0.x.x", | ||
"coveralls": "2.x.x", | ||
@@ -20,0 +19,0 @@ "mocha-lcov-reporter": "0.x.x" |
@@ -36,2 +36,15 @@ var assert = require('assert'), | ||
}); | ||
it('should give all keys in the cache', function(done) { | ||
cache = new Cache({maxSize: 2}); | ||
cache.put('key1', testValue); | ||
cache.put('key2', testValue2); | ||
assert(cache.keys() instanceof Array, 'The keys should be an Array'); | ||
assert.strictEqual(cache.keys().length, 2, 'The number of keys should be 2'); | ||
assert(cache.keys().indexOf('key1') >= 0, 'The array should contain key1'); | ||
assert(cache.keys().indexOf('key2') >= 0, 'The array should contain key2'); | ||
done(); | ||
}); | ||
}); | ||
@@ -38,0 +51,0 @@ describe('get()', function() { |
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
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
19059
6
375
+ Addedclone@0.2.0(transitive)
- Removedclone@0.1.19(transitive)
Updatedclone@0.2.x