{"_id":"@arr/reduce","_rev":"319424","name":"@arr/reduce","description":"A tiny, faster alternative to native Array.prototype.reduce","dist-tags":{"latest":"1.0.3"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"time":{"modified":"2021-06-03T20:13:07.000Z","created":"2017-07-09T00:05:05.753Z","1.0.3":"2020-09-09T17:07:40.887Z","1.0.1":"2019-10-23T11:58:53.675Z","1.0.0":"2017-07-13T01:52:03.100Z","0.2.0":"2017-07-13T01:47:56.157Z","0.1.0":"2017-07-09T00:05:05.753Z"},"users":{},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"repository":{"type":"git","url":"git+https://github.com/lukeed/arr.git"},"versions":{"1.0.3":{"name":"@arr/reduce","version":"1.0.3","repository":{"type":"git","url":"git+https://github.com/lukeed/arr.git"},"description":"A tiny, faster alternative to native Array.prototype.reduce","types":"module.d.ts","module":"module.js","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"keywords":["arr","array","Array.reduce","Array.prototype.reduce","performance","native","reduce"],"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/lukeed/arr/issues"},"homepage":"https://github.com/lukeed/arr#readme","_id":"@arr/reduce@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"36ebd87c95bfd48f7bfa03aed4b7ffd7ff682752","size":1269,"noattachment":false,"key":"/@arr/reduce/-/@arr/reduce-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@arr/reduce/download/@arr/reduce-1.0.3.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce_1.0.3_1599671260780_0.24761299419000782"},"_hasShrinkwrap":false,"publish_time":1599671260887,"_cnpm_publish_time":1599671260887},"1.0.1":{"name":"@arr/reduce","version":"1.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/arr.git"},"description":"A tiny, faster alternative to native Array.prototype.reduce","types":"module.d.ts","module":"module.js","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"keywords":["arr","array","Array.reduce","Array.prototype.reduce","performance","native","reduce"],"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/lukeed/arr/issues"},"homepage":"https://github.com/lukeed/arr#readme","_id":"@arr/reduce@1.0.1","_nodeVersion":"12.11.1","_npmVersion":"6.11.3","dist":{"shasum":"f2822dc86c3159bf9b9966d7fad5c97ef4a62fc3","size":1234,"noattachment":false,"key":"/@arr/reduce/-/@arr/reduce-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@arr/reduce/download/@arr/reduce-1.0.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce_1.0.1_1571831933568_0.5282514912689196"},"_hasShrinkwrap":false,"publish_time":1571831933675,"_cnpm_publish_time":1571831933675},"1.0.0":{"name":"@arr/reduce","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/arr.git"},"description":"A tiny, faster alternative to native Array.prototype.reduce","module":"module.js","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"bench":"node bench","test":"tape test/*.js | tap-spec"},"files":["*.js"],"keywords":["arr","array","Array.reduce","Array.prototype.reduce","performance","native","reduce"],"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/lukeed/arr/issues"},"homepage":"https://github.com/lukeed/arr#readme","_id":"@arr/reduce@1.0.0","_shasum":"a450b3052055987ccd6ccdcfd0e3f4a40aaba227","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"a450b3052055987ccd6ccdcfd0e3f4a40aaba227","size":1186,"noattachment":false,"key":"/@arr/reduce/-/@arr/reduce-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@arr/reduce/download/@arr/reduce-1.0.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce-1.0.0.tgz_1499910722965_0.8436523550190032"},"directories":{},"publish_time":1499910723100,"_hasShrinkwrap":false,"_cnpm_publish_time":1499910723100},"0.2.0":{"name":"@arr/reduce","version":"0.2.0","repository":{"type":"git","url":"git+https://github.com/lukeed/arr.git"},"description":"A tiny, faster alternative to native Array.prototype.reduce","module":"module.js","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"bench":"node bench","test":"tape test/*.js | tap-spec"},"files":["*.js"],"keywords":["arr","array","Array.reduce","Array.prototype.reduce","performance","native","reduce"],"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/lukeed/arr/issues"},"homepage":"https://github.com/lukeed/arr#readme","_id":"@arr/reduce@0.2.0","_shasum":"c299c0d280ba0a4aeb6f981599fdc812902d0e40","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"c299c0d280ba0a4aeb6f981599fdc812902d0e40","size":1185,"noattachment":false,"key":"/@arr/reduce/-/@arr/reduce-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@arr/reduce/download/@arr/reduce-0.2.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce-0.2.0.tgz_1499910475843_0.1545129658188671"},"directories":{},"publish_time":1499910476157,"_hasShrinkwrap":false,"_cnpm_publish_time":1499910476157},"0.1.0":{"name":"@arr/reduce","version":"0.1.0","repository":{"type":"git","url":"git+https://github.com/lukeed/arr.git"},"description":"A tiny, faster alternative to native Array.prototype.reduce","module":"module.js","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"bench":"node bench","test":"tape test/*.js | tap-spec"},"files":["*.js"],"keywords":["arr","array","Array.reduce","Array.prototype.reduce","performance","native","reduce"],"publishConfig":{"access":"public"},"bugs":{"url":"https://github.com/lukeed/arr/issues"},"homepage":"https://github.com/lukeed/arr#readme","_id":"@arr/reduce@0.1.0","_shasum":"f402e6a99861aec565f838fd602681dccba9da70","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"f402e6a99861aec565f838fd602681dccba9da70","size":650,"noattachment":false,"key":"/@arr/reduce/-/@arr/reduce-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@arr/reduce/download/@arr/reduce-0.1.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/reduce-0.1.0.tgz_1499558705624_0.6138374120928347"},"directories":{},"publish_time":1499558705753,"_hasShrinkwrap":false,"_cnpm_publish_time":1499558705753}},"readme":"# @arr/reduce\n\n> A tiny, faster alternative to native `Array.prototype.reduce`\n\n## Install\n\n```\n$ npm install --save @arr/reduce\n```\n\n## Usage\n\n```js\nimport reduce from '@arr/reduce';\n\nconst total = reduce([0, 1, 2, 3], (sum, value) => sum + value);\n//=> 6\n\nconst flattened = reduce([[0, 1], [2, 3], [4, 5]], (a, b) => a.concat(b), []);\n//=> [0, 1, 2, 3, 4, 5]\n```\n\n## API\n\n### reduce(arr, callback[, initialValue])\n\n#### arr\nType: `Array`<br>\nThe array to iterate upon.\n\n#### callback(accumulator, value, index, array)\nType: `Function`<br>\nFunction to test for each element, taking four arguments:\n\n* **accumulator** -- The accumulator accumulates the callback's return values.\n* **value** -- The current element being processed in the array.\n* **index** -- The index of the current element being processed in the array.\n* **array** -- The array `reduce` was called upon.\n\n#### initialValue\nType: `Mixed`<br>\nDefault: `arr[0]`<br>\nThe `value` to use as the first argument to the first call of the `callback`. If no initial value is supplied, the first element in the array will be used.\n\n\n## License\n\nMIT © [Luke Edwards](http://lukeed.com)\n","_attachments":{},"homepage":"https://github.com/lukeed/arr#readme","bugs":{"url":"https://github.com/lukeed/arr/issues"},"license":"MIT"}