diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/lru-cache/README.md | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/lru-cache/README.md')
-rw-r--r-- | node_modules/lru-cache/README.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/node_modules/lru-cache/README.md b/node_modules/lru-cache/README.md index f646c1cb8..d660dd574 100644 --- a/node_modules/lru-cache/README.md +++ b/node_modules/lru-cache/README.md @@ -25,10 +25,16 @@ cache.set("key", "value") cache.get("key") // "value" // non-string keys ARE fully supported -var someObject = {} +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } cache.set(someObject, 'a value') +// Object keys are not toString()-ed cache.set('[object Object]', 'a different value') assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) cache.reset() // empty the cache ``` |