aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2017-07-14 10:52:48 -0700
committerJames M Snell <jasnell@gmail.com>2017-07-17 08:49:02 -0700
commit24f43903b4a2f5aa73a99e6f3d4cc62d559cf94b (patch)
tree9c32bd08c43de8721e54cd846d816fbe6cdf056e /deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md
parentfa73087fcf4bd14db7791120e688a0a508885b64 (diff)
downloadandroid-node-v8-24f43903b4a2f5aa73a99e6f3d4cc62d559cf94b.tar.gz
android-node-v8-24f43903b4a2f5aa73a99e6f3d4cc62d559cf94b.tar.bz2
android-node-v8-24f43903b4a2f5aa73a99e6f3d4cc62d559cf94b.zip
deps: upgrade npm to 5.3.0
PR-URL: https://github.com/nodejs/node/pull/14235 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md')
-rw-r--r--deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md60
1 files changed, 60 insertions, 0 deletions
diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md
new file mode 100644
index 0000000000..778bf01dfa
--- /dev/null
+++ b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md
@@ -0,0 +1,60 @@
+# pseudomap
+
+A thing that is a lot like ES6 `Map`, but without iterators, for use
+in environments where `for..of` syntax and `Map` are not available.
+
+If you need iterators, or just in general a more faithful polyfill to
+ES6 Maps, check out [es6-map](http://npm.im/es6-map).
+
+If you are in an environment where `Map` is supported, then that will
+be returned instead, unless `process.env.TEST_PSEUDOMAP` is set.
+
+You can use any value as keys, and any value as data. Setting again
+with the identical key will overwrite the previous value.
+
+Internally, data is stored on an `Object.create(null)` style object.
+The key is coerced to a string to generate the key on the internal
+data-bag object. The original key used is stored along with the data.
+
+In the event of a stringified-key collision, a new key is generated by
+appending an increasing number to the stringified-key until finding
+either the intended key or an empty spot.
+
+Note that because object traversal order of plain objects is not
+guaranteed to be identical to insertion order, the insertion order
+guarantee of `Map.prototype.forEach` is not guaranteed in this
+implementation. However, in all versions of Node.js and V8 where this
+module works, `forEach` does traverse data in insertion order.
+
+## API
+
+Most of the [Map
+API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map),
+with the following exceptions:
+
+1. A `Map` object is not an iterator.
+2. `values`, `keys`, and `entries` methods are not implemented,
+ because they return iterators.
+3. The argument to the constructor can be an Array of `[key, value]`
+ pairs, or a `Map` or `PseudoMap` object. But, since iterators
+ aren't used, passing any plain-old iterator won't initialize the
+ map properly.
+
+## USAGE
+
+Use just like a regular ES6 Map.
+
+```javascript
+var PseudoMap = require('pseudomap')
+
+// optionally provide a pseudomap, or an array of [key,value] pairs
+// as the argument to initialize the map with
+var myMap = new PseudoMap()
+
+myMap.set(1, 'number 1')
+myMap.set('1', 'string 1')
+var akey = {}
+var bkey = {}
+myMap.set(akey, { some: 'data' })
+myMap.set(bkey, { some: 'other data' })
+```