diff options
author | isaacs <i@izs.me> | 2012-08-27 23:07:14 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-08-27 23:07:14 +0400 |
commit | 4067f7c1e9e34a72dbc1a63365feb1447dc00bb7 (patch) | |
tree | 3f7577e3084c527747b8e8693e1ae936d8370971 /node_modules/lru-cache | |
parent | b736d94a27fca5fe0d334b22593997dcb9720faf (diff) |
lru-cache@2.0.2
Diffstat (limited to 'node_modules/lru-cache')
-rw-r--r-- | node_modules/lru-cache/AUTHORS | 1 | ||||
-rw-r--r-- | node_modules/lru-cache/lib/lru-cache.js | 4 | ||||
-rw-r--r-- | node_modules/lru-cache/package.json | 13 |
3 files changed, 11 insertions, 7 deletions
diff --git a/node_modules/lru-cache/AUTHORS b/node_modules/lru-cache/AUTHORS index 82f1a6675..016d7fbe1 100644 --- a/node_modules/lru-cache/AUTHORS +++ b/node_modules/lru-cache/AUTHORS @@ -5,3 +5,4 @@ Marko Mikulicic <marko.mikulicic@isti.cnr.it> Trent Mick <trentm@gmail.com> Kevin O'Hara <kevinohara80@gmail.com> Marco Rogers <marco.rogers@gmail.com> +Jesse Dailey <jesse.dailey@gmail.com> diff --git a/node_modules/lru-cache/lib/lru-cache.js b/node_modules/lru-cache/lib/lru-cache.js index 27a9a5e93..8b6ed8c2e 100644 --- a/node_modules/lru-cache/lib/lru-cache.js +++ b/node_modules/lru-cache/lib/lru-cache.js @@ -172,7 +172,9 @@ function LRUCache (options) { function lruWalk () { // lru has been deleted, hop up to the next hit. - lru = Object.keys(lruList)[0] + for (var key in lruList) { + return key + } } function trim () { diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json index e2457f720..9428d83fb 100644 --- a/node_modules/lru-cache/package.json +++ b/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "2.0.1", + "version": "2.0.2", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me" @@ -45,12 +45,13 @@ { "name": "Marco Rogers", "email": "marco.rogers@gmail.com" + }, + { + "name": "Jesse Dailey", + "email": "jesse.dailey@gmail.com" } ], "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum number of items. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n", - "_id": "lru-cache@2.0.1", - "dist": { - "shasum": "8cbbcca2f72b07e18510cb1451073cd4afab0826" - }, - "_from": "lru-cache@2.0.1" + "_id": "lru-cache@2.0.2", + "_from": "lru-cache@~2.0.0" } |