apr-reduce
Advanced tools
Comparing version 1.0.1 to 1.0.2
19
index.js
const defaults = require('lodash.defaults'); | ||
const each = require('apr-engine-each'); | ||
/** | ||
* <a id="reduce"></a> | ||
* Reduces `coll` into a single value using an async `iteratee` to return each successive step. | ||
* | ||
* [![](https://img.shields.io/npm/v/apr-reduce.svg?style=flat-square)](https://www.npmjs.com/package/apr-reduce) [![](https://img.shields.io/npm/l/apr-reduce.svg?style=flat-square)](https://www.npmjs.com/package/apr-reduce) | ||
* | ||
* @kind function | ||
* @name reduce | ||
* @param {Array|Object|Iterable} input | ||
* @param {Function} iteratee | ||
* @returns {Promise} | ||
* | ||
* @example | ||
* import reduce from 'apr-reduce'; | ||
* | ||
* const sum = await reduce([1, 2, 3], async (sum, item) => | ||
* new Promise((resolve) => resolve(sum + item)) | ||
* ); | ||
*/ | ||
module.exports = (input, fn, sum, opts) => { | ||
@@ -5,0 +24,0 @@ return each({ |
{ | ||
"name": "apr-reduce", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/ramitos/apr/tree/master/packages/reduce", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
2525
3
37
1
26