{"_id":"sorted-array-functions","_rev":"7-212bfb9bb90d855e5e1dd0e9d7fe2833","name":"sorted-array-functions","description":"Maintain and search through a sorted array using some low level functions","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"sorted-array-functions","version":"1.0.0","description":"Maintain and search through a sorted array using some low level functions","main":"index.js","dependencies":{},"devDependencies":{"standard":"^8.4.0","tape":"^4.6.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sorted-array-functions.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sorted-array-functions/issues"},"homepage":"https://github.com/mafintosh/sorted-array-functions","gitHead":"39ca88126e01bc23d98a7c11a9989db6059126e5","_id":"sorted-array-functions@1.0.0","_shasum":"c0b554d9e709affcbe56d34c1b2514197fd38279","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"c0b554d9e709affcbe56d34c1b2514197fd38279","tarball":"https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.0.0.tgz","integrity":"sha512-6Wyc703rvlgWk0JsCsEkAqmeSA6KxCFmC5Eq9mGuae0GolfWIfXH4oeXwsqnQGT8f1YoibEXcTOyfuht639ojg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICh1teRl2ncjZh8aui8MjLAfKceuV6FBarkYvPRt200ZAiEAk6s1NgB0CRTCdDk5r1immmnlNoyD3zJOBvMYrpzix2c="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sorted-array-functions-1.0.0.tgz_1477213265074_0.4219658076763153"},"directories":{}},"1.1.0":{"name":"sorted-array-functions","version":"1.1.0","description":"Maintain and search through a sorted array using some low level functions","main":"index.js","dependencies":{},"devDependencies":{"standard":"^8.4.0","tape":"^4.6.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sorted-array-functions.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sorted-array-functions/issues"},"homepage":"https://github.com/mafintosh/sorted-array-functions","gitHead":"48487c6940fd1867d1a1357267a25a86a348f3eb","_id":"sorted-array-functions@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-zq6fLdGQixb9VZfT/tLgU+LzoedJyTbcf1I/TKETFeUVoWIfcs5HNr+SJSvQJLXRlEZjB1gpILTrxamxAdCcgA==","shasum":"78fe5808ffa1beebac2ce9a22d76039dabc599ff","tarball":"https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ9ztlhZXepWxXkaCSahJHpmEIZeKhkVCNkAQ9F8bX0wIgKrHIVXmxCUK+co3XIV2Web2e42Bsd+qYRXyuy3rrDEU="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sorted-array-functions-1.1.0.tgz_1514473270149_0.9288073291536421"},"directories":{}},"1.2.0":{"name":"sorted-array-functions","version":"1.2.0","description":"Maintain and search through a sorted array using some low level functions","main":"index.js","dependencies":{},"devDependencies":{"standard":"^8.4.0","tape":"^4.6.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sorted-array-functions.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sorted-array-functions/issues"},"homepage":"https://github.com/mafintosh/sorted-array-functions","gitHead":"450fcd06b8fb93a379ea736a2df781422f9b4f9f","_id":"sorted-array-functions@1.2.0","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-sWpjPhIZJtqO77GN+LD8dDsDKcWZ9GCOJNqKzi1tvtjGIzwfoyuRH8S0psunmc6Z5P+qfDqztSbwYR5X/e1UTg==","shasum":"43265b21d6e985b7df31621b1c11cc68d8efc7c3","tarball":"https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.2.0.tgz","fileCount":7,"unpackedSize":15844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEqjpCRA9TVsSAnZWagAAnzcP/RZ6yE9ex/Ab6CpnNhlB\ncHg95EPo+ibY6/hHJS74/qvqMhfnzAxROUamyW62BiyJ41hzYPXgfDzpkCm7\nR2f+uSpdXKJxtYJpkp3niTUYdtdlTaRbOVefnSqzIuO4J2Kz6oGn115cl1Im\n0+KKS4ecSz3pUEl8tXbKiZJpqykDpLsw81mi5N5m+b56/iNMy9QITofNiLcT\nWTBznzj1PhzzNB50sgstwVv7eXDPAIr+18eihzTVLeQS4ml0+wQZvBF5ZAHm\n6jSpyIRLGfuJ78yy6KUp8kx0hTyOc8brDx/nGXrb7n3H3u0O5uwsv8rPmqLo\n/wb3mTM9Yes/9h3Rz2lJ0/tQH+vVmNUvWGer8Y6Jo9Rmm0KB/nOn4ceduDat\nNopHT2tC/Hm92LAVKWxS5gqQoii5Sr1qkxvG3T97Lxpw5nvb7eM0VJYtAbbJ\nwEjxde8Lhl/GENeO+tM8PJLUxOPGoW8JzCI9AJWp9+KX+YzcWxrVN9QGCeEE\nnyAKfpt5Aw83iBHEgfMQPoQfEc2El5nJiT8f2oMUGNdf/n3GdZ58meAiRHoV\nYyXr1Ge1QC3zLYp8PbWNQq86uZc4npZLVcBy7Gb5argQwP+L7IfDqJfX75/t\nNtSU0f+4d2zxZx1GnI0DOg6Ho3hib5k7/FQkKxHiFkxx/Wy6bPwz0S+0567t\n5ZWp\r\n=RX3S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB0IUVZNlmNsSuEUiW1HTqz8Ye/UI8L12d0/+mxN6BYuAiBtcRvJHFYa3avTXGtvSuIAsE0SZY2ccHVm/sRYagcmgw=="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sorted-array-functions_1.2.0_1527949544551_0.48349449992811167"},"_hasShrinkwrap":false},"1.3.0":{"name":"sorted-array-functions","version":"1.3.0","description":"Maintain and search through a sorted array using some low level functions","main":"index.js","dependencies":{},"devDependencies":{"standard":"^8.4.0","tape":"^4.6.2"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sorted-array-functions.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sorted-array-functions/issues"},"homepage":"https://github.com/mafintosh/sorted-array-functions","gitHead":"82c6a4cbf5c1e667805a388d5d3ebedac0fe07c7","_id":"sorted-array-functions@1.3.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-2sqgzeFlid6N4Z2fUQ1cvFmTOLRi/sEDzSQ0OKYchqgoPmQBVyM3959qYx3fpS6Esef80KjmpgPeEr028dP3OA==","shasum":"8605695563294dffb2c9796d602bd8459f7a0dd5","tarball":"https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.3.0.tgz","fileCount":7,"unpackedSize":16576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ4jvCRA9TVsSAnZWagAAMgAQAJzIFAaavLFERAPwNeOv\nZBHl47W2nfoKrXl4DqKzLN/Ql95H11Lltp8lZZO1drbTdkvSGnCsyey+7ilW\nviYCLjEKs0vjTTXKNsWpnD5MnbCTuK6XNQ59wJF6sdP4Lc8MbTrvwkKqcC9R\nJu2k8uak59TdS1+qnISWMME6NOEHoMSL5APB+rAH+nyuYJvGR2Di9SagzVhk\n1mjQUQaX0aHAhCB//C0G8/IjA/SWRm0dzPI57JYFlWbKu8Ojp3Oxd+LPWuwe\nHYB5ehdx1GFX6eJrygh+q1FImbzTEjq1ynCKVP7IYTK0VzULBCl6tv/OJsD8\nL5mw8EjHEmZi9N9T3p8SRJbLXOYZ2Z//pPaRq5kWRrrvwuV7DXY2QWGhlYLd\neiKWBC4fHOCfRulzljbibOnGx4wGB60H5G4WraMs4Iezf+fMcWEh1Qb3RklP\nJIo0XHPyLEpLhJ32Brhsee86n6cZbln+epHfoixjyQByGCjs6DfpQqU0un3w\nAoTT4BeEZt0pJeGmRdSgD3cLtbGM1TM3g8zYBk8l0s0uSU7lTX6+m8DyE3TF\noC/L8c0E8z28K0Bt1W56X3fAQGfzXXsgilj9blwMvj2nUZiP/Tr6kKtSmkE+\ncnh2orWcf3uPSLX46aL1KMimYi8q8niEtiofL6/sHnTBkvpK39OxFuGLgcdm\nqY4e\r\n=5rZw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJxP9mpcSGZLbGQcNEjGdpkoV+i75cSkcMrlQuWa1JMAIhAOkNuZVBAevee0Wjkw8dpUSULPXQ2qYiaRJp4PlUB2xq"}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sorted-array-functions_1.3.0_1598261486831_0.6916830752109484"},"_hasShrinkwrap":false}},"readme":"# sorted-array-functions\n\nMaintain and search through a sorted array using some low level functions\n\n```\nnpm install sorted-array-functions\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/sorted-array-functions.svg?style=flat)](http://travis-ci.org/mafintosh/sorted-array-functions)\n\n## Usage\n\n``` js\nvar sorted = require('sorted-array-functions')\nvar list = []\n\nsorted.add(list, 1)\nsorted.add(list, 4)\nsorted.add(list, 2)\n\nconsole.log(list) // prints out [1, 2, 4]\nconsole.log(sorted.has(list, 2)) // returns true\nconsole.log(sorted.has(list, 3)) // returns false\nconsole.log(sorted.eq(list, 2)) // returns 1 (the index)\nconsole.log(sorted.gt(list, 2)) // returns 2\nconsole.log(sorted.gt(list, 4)) // returns -1\n```\n\n## API\n\n#### `sorted.add(list, value, [compare])`\n\nInsert a new value into the list sorted.\nOptionally you can use a custom compare function that returns, `compare(a, b)` that returns 1 if `a > b`, 0 if `a === b` and -1 if `a < b`.\n\n#### `sorted.addFromFront(list, value, [compare])`\n\nInserts a new value (same result as `sorted.add()`) optimized for prepend.\n\n#### `var bool = sorted.remove(list, value, [compare])`\n\nRemove a value. Returns true if the value was in the list.\n\n#### `var bool = sorted.has(list, value, [compare])`\n\nCheck if a value is in the list.\n\n#### `var index = sorted.eq(list, value, [compare])`\n\nGet the index of a value in the list (uses binary search).\nIf the value could not be found -1 is returned.\n\n#### `var index = sorted.gte(list, value, [compare])`\n\nGet the index of the first value that is `>=`.\nIf the value could not be found -1 is returned.\n\n#### `var index = sorted.gt(list, value, [compare])`\n\nGet the index of the first value that is `>`.\nIf the value could not be found -1 is returned.\n\n#### `var index = sorted.lte(list, value, [compare])`\n\nGet the index of the first value that is `<=`.\nIf the value could not be found -1 is returned.\n\n#### `var index = sorted.lt(list, value, [compare])`\n\nGet the index of the first value that is `<`.\nIf the value could not be found -1 is returned.\n\n## License\n\nMIT\n","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"time":{"modified":"2022-06-26T22:17:45.100Z","created":"2016-10-23T09:01:07.033Z","1.0.0":"2016-10-23T09:01:07.033Z","1.1.0":"2017-12-28T15:01:11.036Z","1.2.0":"2018-06-02T14:25:44.657Z","1.3.0":"2020-08-24T09:31:26.970Z"},"homepage":"https://github.com/mafintosh/sorted-array-functions","repository":{"type":"git","url":"git+https://github.com/mafintosh/sorted-array-functions.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/sorted-array-functions/issues"},"license":"MIT","readmeFilename":"README.md"}