{"_id":"unordered-set","_rev":"401944","name":"unordered-set","description":"A couple of functions that make it easy to maintain an unordered set as an array in an efficient way","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-04T04:33:58.000Z","created":"2016-02-08T16:54:04.821Z","2.0.1":"2018-06-11T10:29:27.256Z","2.0.0":"2016-06-30T18:21:59.749Z","1.1.0":"2016-02-08T18:06:11.529Z","1.0.1":"2016-02-08T16:58:35.482Z","1.0.0":"2016-02-08T16:54:04.821Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/unordered-set.git"},"versions":{"2.0.1":{"name":"unordered-set","version":"2.0.1","description":"A couple of functions that make it easy to maintain an unordered set as an array in an efficient way","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/unordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/unordered-set/issues"},"homepage":"https://github.com/mafintosh/unordered-set","gitHead":"aacee8d298750a52e928d8477a43a97d0fd6d97f","_id":"unordered-set@2.0.1","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"4cd0fe27b8814bcf5d6073e5f0966ec7a50841e6","size":2213,"noattachment":false,"key":"/unordered-set/-/unordered-set-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/unordered-set/download/unordered-set-2.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unordered-set_2.0.1_1528712967195_0.8074148081063268"},"_hasShrinkwrap":false,"publish_time":1528712967256,"_cnpm_publish_time":1528712967256},"2.0.0":{"name":"unordered-set","version":"2.0.0","description":"A couple of functions that make it easy to maintain an unordered set as an array in an efficient way","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/unordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/unordered-set/issues"},"homepage":"https://github.com/mafintosh/unordered-set","gitHead":"542bc9e6489722ab290ca5b9f9f78363ff43c1e2","_id":"unordered-set@2.0.0","_shasum":"985a27e975baa20b8263aea7a791e9300941a9ec","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"985a27e975baa20b8263aea7a791e9300941a9ec","size":2279,"noattachment":false,"key":"/unordered-set/-/unordered-set-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/unordered-set/download/unordered-set-2.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/unordered-set-2.0.0.tgz_1467310917369_0.06565805524587631"},"directories":{},"publish_time":1467310919749,"_cnpm_publish_time":1467310919749,"_hasShrinkwrap":false},"1.1.0":{"name":"unordered-set","version":"1.1.0","description":"A couple of functions that make it easy to maintain an unordered set as an array in an efficient way","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/unordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/unordered-set/issues"},"homepage":"https://github.com/mafintosh/unordered-set","gitHead":"97787688aba10779b6989a4c5115d709bed658ae","_id":"unordered-set@1.1.0","_shasum":"2ba7ef316edd0b9590cc547c74f76a2f164fecca","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"2ba7ef316edd0b9590cc547c74f76a2f164fecca","size":2271,"noattachment":false,"key":"/unordered-set/-/unordered-set-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/unordered-set/download/unordered-set-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/unordered-set-1.1.0.tgz_1454954768514_0.567512724082917"},"directories":{},"publish_time":1454954771529,"_cnpm_publish_time":1454954771529,"_hasShrinkwrap":false},"1.0.1":{"name":"unordered-set","version":"1.0.1","description":"A couple of functions that make it easy to maintain an unordered set as an array in an efficient way","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/unordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/unordered-set/issues"},"homepage":"https://github.com/mafintosh/unordered-set","gitHead":"15ff2890b25c85a5b551573a4952195195cc97ce","_id":"unordered-set@1.0.1","_shasum":"a5dab43059e68e2a212818d3c9cad625b4b7e632","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"a5dab43059e68e2a212818d3c9cad625b4b7e632","size":2155,"noattachment":false,"key":"/unordered-set/-/unordered-set-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/unordered-set/download/unordered-set-1.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/unordered-set-1.0.1.tgz_1454950712703_0.13522293069399893"},"directories":{},"publish_time":1454950715482,"_cnpm_publish_time":1454950715482,"_hasShrinkwrap":false},"1.0.0":{"name":"unordered-set","version":"1.0.0","description":"A couple of functions that make it easy to maintain an unordered set as an array in an efficient way","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.4","tape":"^4.4.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/unordered-set.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/unordered-set/issues"},"homepage":"https://github.com/mafintosh/unordered-set","gitHead":"43ce26ba9047754ad84316552f663d1f6e5181b1","_id":"unordered-set@1.0.0","_shasum":"cd274b3728584162429803345491acda2727185e","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.6","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"cd274b3728584162429803345491acda2727185e","size":2217,"noattachment":false,"key":"/unordered-set/-/unordered-set-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/unordered-set/download/unordered-set-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/unordered-set-1.0.0.tgz_1454950442013_0.709912576014176"},"directories":{},"publish_time":1454950444821,"_cnpm_publish_time":1454950444821,"_hasShrinkwrap":false}},"readme":"# unordered-set\n\nA couple of functions that make it easy to maintain an unordered set as an array in an efficient way\n\n```\nnpm install unordered-set\n```\n\n[![build status](https://travis-ci.org/mafintosh/unordered-set.svg?branch=master)](https://travis-ci.org/mafintosh/unordered-set)\n\n## Usage\n\n``` js\nvar set = require('unordered-set')\nvar list = []\n\nvar a = {hello: 'world'}\nvar b = {hej: 'verden'}\n\nset.add(list, a)\nset.add(list, b)\n\nconsole.log(list) // prints a and b\n\nset.remove(list, a)\n\nconsole.log(list) // prints b\n```\n\nItems are removed and added using the same technique as in [unordered-array-remove](https://github.com/mafintosh/unordered-array-remove)\nmaking the removal/additions run in O(1).\n\n## API\n\n#### `set.add(list, item)`\n\nAdd an item. Notes that this sets the property `._index` to a number. If you control the items you insert and this is performance critical it might be benefitial to set `item._index = 0` in the item constructor as v8 tends to like that.\n\n#### `set.remove(list, item)`\n\nRemove an item from the set. Might change the order of the list as well.\n\n#### `bool = set.has(list, item)`\n\nReturns `true` if the item is in the list and `false` otherwise\n\n#### `set.swap(list, a, b)`\n\nSwap the positions of two elements in the set\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/unordered-set","bugs":{"url":"https://github.com/mafintosh/unordered-set/issues"},"license":"MIT"}