{"_id":"set","_rev":"246847","name":"set","description":"An implementation of Sets in JavaScript","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"gkatsev","email":"me@gkatsev.com"}],"time":{"modified":"2021-06-03T16:04:44.000Z","created":"2011-04-12T03:11:22.310Z","1.1.1":"2014-05-03T22:39:10.834Z","1.1.0":"2014-05-03T22:36:12.107Z","1.0.1":"2013-07-26T04:33:33.064Z","1.0.0":"2011-04-12T03:11:22.310Z"},"users":{"9joneg":true,"detj":true,"parkerproject":true},"author":{"name":"Gary Katsevman","email":"me@gkatsev.com","url":"gkatsev.com"},"repository":{"type":"git","url":"https://github.com/gkatsev/set.js"},"versions":{"1.1.1":{"name":"set","version":"1.1.1","description":"An implementation of Sets in JavaScript","main":"set","scripts":{"test":"vows"},"repository":{"type":"git","url":"https://github.com/gkatsev/set.js"},"bugs":{"url":"https://github.com/gkatev/set.js/issues"},"directories":{"lib":"."},"keywords":["set","intersect","union","difference"],"author":{"name":"Gary Katsevman","email":"me@gkatsev.com","url":"gkatsev.com"},"license":{"type":"MIT","url":"http://gkatsev.mit-license.org/"},"devDependencies":{"vows":"*"},"engines":{"node":"*"},"homepage":"https://github.com/gkatsev/set.js","_id":"set@1.1.1","dist":{"shasum":"b91d758036844b3bf4d4b7ae605bdf92a304746c","size":3811,"noattachment":false,"key":"/set/-/set-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/set/download/set-1.1.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"gkatsev","email":"me@gkatsev.com"},"maintainers":[{"name":"gkatsev","email":"me@gkatsev.com"}],"publish_time":1399156750834,"_cnpm_publish_time":1399156750834,"_hasShrinkwrap":false},"1.1.0":{"name":"set","version":"1.1.0","description":"An implementation of Sets in JavaScript","main":"set","scripts":{"test":"vows"},"repository":{"type":"git","url":"https://github.com/gkatsev/set.js"},"bugs":{"url":"https://github.com/gkatev/set.js/issues"},"directories":{"lib":"."},"keywords":["set","intersect","union","difference"],"author":{"name":"Gary Katsevman","email":"me@gkatsev.com","url":"gkatsev.com"},"license":{"type":"MIT","url":"http://gkatsev.mit-license.org/"},"devDependencies":{"vows":"*"},"engines":{"node":"*"},"homepage":"https://github.com/gkatsev/set.js","_id":"set@1.1.0","dist":{"shasum":"8aaf1b486b8a7a48e34c660be9b6790320fa8d2f","size":3795,"noattachment":false,"key":"/set/-/set-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set/download/set-1.1.0.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"gkatsev","email":"me@gkatsev.com"},"maintainers":[{"name":"gkatsev","email":"me@gkatsev.com"}],"publish_time":1399156572107,"_cnpm_publish_time":1399156572107,"_hasShrinkwrap":false},"1.0.1":{"name":"set","version":"1.0.1","description":"An implementation of Sets in JavaScript","main":"set","scripts":{"test":"vows"},"repository":{"type":"git","url":"https://github.com/gkatsev/set.js"},"bugs":{"url":"https://github.com/gkatev/set.js/issues"},"directories":{"lib":"."},"keywords":["set","intersect","union","difference"],"author":{"name":"Gary Katsevman","email":"me@gkatsev.com","url":"gkatsev.com"},"license":{"type":"MIT","url":"http://gkatsev.mit-license.org/"},"readmeFilename":"README.md","devDependencies":{"vows":"*"},"engines":{"node":"*"},"_id":"set@1.0.1","dist":{"shasum":"9c37f5f0adedb926e5391b0e6ad4b09fb6cf5c97","size":3325,"noattachment":false,"key":"/set/-/set-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/set/download/set-1.0.1.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"gkatsev","email":"me@gkatsev.com"},"maintainers":[{"name":"gkatsev","email":"me@gkatsev.com"}],"publish_time":1374813213064,"_hasShrinkwrap":false,"_cnpm_publish_time":1374813213064},"1.0.0":{"name":"set","description":"An implementation of Sets in JavaScript","version":"1.0.0","repository":"git://github.com/gkatsev/set.js.git","author":{"name":"Gary Katsevman","email":"me@gkatsev.com","url":"gkatsev.com"},"main":"set","directories":{"lib":"."},"scripts":{"test":"vows tests.js"},"engines":{"node":"*"},"_id":"set@1.0.0","_engineSupported":true,"_npmVersion":"0.2.17","_nodeVersion":"v0.4.0-pre","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"a065f28f9e128f0c09486818f00fe73388a2c174","size":22969,"noattachment":false,"key":"/set/-/set-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/set/download/set-1.0.0.tgz"},"publish_time":1302577882310,"maintainers":[{"name":"gkatsev","email":"me@gkatsev.com"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1302577882310}},"readme":"# Set.js\n[![Build Status](https://travis-ci.org/gkatsev/set.js.png?branch=master)](https://travis-ci.org/gkatsev/set.js)\n[![Dependency Status](https://david-dm.org/gkatsev/set.js.png)](https://david-dm.org/gkatsev/set.js)\n[![devDependency Status](https://david-dm.org/gkatsev/set.js/dev-status.png)](https://david-dm.org/gkatsev/set.js#info=devDependencies)\n[![NPM](https://nodei.co/npm/set.png)](https://nodei.co/npm/set/)\n\n## Usage\n\nCreate an array of items and then pass it to Set.\n`var Set = require('./set')`\n`var set = new Set([0,1,1])`\nAnd then when we get it\n`set.get() // [0,1]`\n\n### Note on input types\nThis module casts inputs into strings. Objects and Arrays are turned into JSON with `JSON.stringify`.\nThis makes this module fairly simple as it doesn't allow complex objects to be stored. However, given that Objects and Arrays are now JSONified, these objects can now be compared according to their JSON output. To make two objects unique, give them a different output for their `toJSON` method.\n\nIn a future version, this module would use a javascript Set as the datastructure and therefore won't have this limitation, but Sets are quite ready yet.\n\n## API\nThere are various Set functions available\n\n### Static functions\n* `Set#unique` given an array, return an array with all duplicates removed.\n\n### Instance functions\n* `Set#contains` return whether a given property is available.\n* `Set#empty` return whether the set in empty.\n* `Set#size` return the size of the Set.\n* `Set#get` return the set as an Array.\n\n* `Set#add` add an item to the Set.\n* `Set#remove` remove an item from the set.\n* `Set#clear` remove all items from the set.\n\n* `Set#union` return a new set that is the union of the set with another one.\n* `Set#intersect` return a new set that is the intersection of the set with another one.\n* `Set#difference` return a new set that is the difference of the set with another one.\n\n* `Set#find` return an array with all items that match the predicate.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2011 George \"Gary\" Katsevman\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_attachments":{},"homepage":"https://github.com/gkatsev/set.js","bugs":{"url":"https://github.com/gkatev/set.js/issues"},"license":{"type":"MIT","url":"http://gkatsev.mit-license.org/"}}