@@ -100,31 +100,31 @@ Convert sync function to Promise object
100
100
101
101
### map(items, fn, done)
102
102
103
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
103
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
104
104
- ` fn ` : [ ` <Function> ` ] [ function ] to be executed for each value in the array
105
105
- ` current ` : ` <any> ` current element being processed in the array
106
106
- ` callback ` : [ ` <Function> ` ] [ function ]
107
107
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
108
108
- ` value ` : ` <any> `
109
109
- ` done ` : [ ` <Function> ` ] [ function ] on done
110
110
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
111
- - ` result ` : [ ` <Array > ` ] [ array ]
111
+ - ` result ` : [ ` <Iterable > ` ] [ iterable ]
112
112
113
113
Asynchronous map (iterate parallel)
114
114
115
115
### filter(items, fn, done)
116
116
117
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
117
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
118
118
- ` fn ` : [ ` <Function> ` ] [ function ] to be executed for each value in the array
119
119
- ` value ` : ` <any> ` item from items array
120
120
- ` callback ` : [ ` <Function> ` ] [ function ]
121
121
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
122
122
- ` accepted ` : [ ` <boolean> ` ] [ boolean ]
123
123
- ` done ` : [ ` <Function> ` ] [ function ] on done
124
124
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
125
- - ` result ` : [ ` <Array > ` ] [ array ]
125
+ - ` result ` : [ ` <Iterable > ` ] [ iterable ]
126
126
127
- Asynchrous filter (iterate parallel)
127
+ Asynchronous filter (iterate parallel)
128
128
129
129
_ Example:_
130
130
@@ -138,7 +138,7 @@ metasync.filter(
138
138
139
139
### reduce(items, fn, done\[ , initial\] )
140
140
141
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
141
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
142
142
- ` fn ` : [ ` <Function> ` ] [ function ] to be executed for each value in array
143
143
- ` previous ` : ` <any> ` value previously returned in the last iteration
144
144
- ` current ` : ` <any> ` current element being processed in the array
@@ -148,18 +148,18 @@ metasync.filter(
148
148
- ` data ` : ` <any> ` resulting value
149
149
- ` counter ` : [ ` <number> ` ] [ number ] index of the current element being processed
150
150
in array
151
- - ` items ` : [ ` <Array > ` ] [ array ] the array reduce was called upon
152
- - ` done ` : [ ` <Function> ` ] [ function ] on done
151
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] the array reduce was called upon
152
+ - ` done ` : [ ` <Function> ` ] [ function ] on done, optional
153
153
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
154
- - ` result ` : [ ` <Array > ` ] [ array ]
154
+ - ` result ` : [ ` <Iterable > ` ] [ iterable ]
155
155
- ` initial ` : ` <any> ` optional value to be used as first argument in first
156
156
iteration
157
157
158
158
Asynchronous reduce
159
159
160
160
### reduceRight(items, fn, done\[ , initial\] )
161
161
162
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
162
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
163
163
- ` fn ` : [ ` <Function> ` ] [ function ] to be executed for each value in array
164
164
- ` previous ` : ` <any> ` value previously returned in the last iteration
165
165
- ` current ` : ` <any> ` current element being processed in the array
@@ -169,25 +169,25 @@ Asynchronous reduce
169
169
- ` data ` : ` <any> ` resulting value
170
170
- ` counter ` : [ ` <number> ` ] [ number ] index of the current element being processed
171
171
in array
172
- - ` items ` : [ ` <Array > ` ] [ array ] the array reduce was called upon
173
- - ` done ` : [ ` <Function> ` ] [ function ] on done
172
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] the array reduce was called upon
173
+ - ` done ` : [ ` <Function> ` ] [ function ] on done, optional
174
174
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
175
- - ` result ` : [ ` <Array > ` ] [ array ]
175
+ - ` result ` : [ ` <Iterable > ` ] [ iterable ]
176
176
- ` initial ` : ` <any> ` optional value to be used as first argument in first
177
177
iteration
178
178
179
179
Asynchronous reduceRight
180
180
181
181
### each(items, fn, done)
182
182
183
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
183
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
184
184
- ` fn ` : [ ` <Function> ` ] [ function ]
185
185
- ` value ` : ` <any> ` item from items array
186
186
- ` callback ` : [ ` <Function> ` ] [ function ]
187
187
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
188
188
- ` done ` : [ ` <Function> ` ] [ function ] on done
189
189
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
190
- - ` items ` : [ ` <Array > ` ] [ array ]
190
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ]
191
191
192
192
Asynchronous each (iterate in parallel)
193
193
@@ -206,14 +206,14 @@ metasync.each(
206
206
207
207
### series(items, fn, done)
208
208
209
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
209
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
210
210
- ` fn ` : [ ` <Function> ` ] [ function ]
211
211
- ` value ` : ` <any> ` item from items array
212
212
- ` callback ` : [ ` <Function> ` ] [ function ]
213
213
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
214
214
- ` done ` : [ ` <Function> ` ] [ function ] on done
215
215
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
216
- - ` items ` : [ ` <Array > ` ] [ array ]
216
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ]
217
217
218
218
Asynchronous series
219
219
@@ -234,7 +234,7 @@ metasync.series(
234
234
235
235
### find(items, fn, done)
236
236
237
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
237
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
238
238
- ` fn ` : [ ` <Function> ` ] [ function ]
239
239
- ` value ` : ` <any> ` item from items array
240
240
- ` callback ` : [ ` <Function> ` ] [ function ]
@@ -260,7 +260,7 @@ metasync.find(
260
260
261
261
### every(items, fn, done)
262
262
263
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
263
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
264
264
- ` fn ` : [ ` <Function> ` ] [ function ]
265
265
- ` value ` : ` <any> ` item from items array
266
266
- ` callback ` : [ ` <Function> ` ] [ function ]
@@ -274,7 +274,7 @@ Asynchronous every
274
274
275
275
### some(items, fn, done)
276
276
277
- - ` items ` : [ ` <Array > ` ] [ array ] incoming
277
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming
278
278
- ` fn ` : [ ` <Function> ` ] [ function ]
279
279
- ` value ` : ` <any> ` item from items array
280
280
- ` callback ` : [ ` <Function> ` ] [ function ]
@@ -288,7 +288,7 @@ Asynchronous some (iterate in series)
288
288
289
289
### asyncMap(items, fn\[ , options\]\[ , done\] )
290
290
291
- - ` items ` : [ ` <Array > ` ] [ array ] incoming dataset
291
+ - ` items ` : [ ` <Iterable > ` ] [ iterable ] incoming dataset
292
292
- ` fn ` : [ ` <Function> ` ] [ function ]
293
293
- ` item ` : ` <any> `
294
294
- ` index ` : [ ` <number> ` ] [ number ]
@@ -297,7 +297,7 @@ Asynchronous some (iterate in series)
297
297
- ` percent ` : [ ` <number> ` ] [ number ] ratio of map time to all time
298
298
- ` done ` : [ ` <Function> ` ] [ function ] call on done, optional
299
299
- ` err ` : [ ` <Error> ` ] [ error ] |[ ` <null> ` ] [ null ]
300
- - ` result ` : [ ` <Array > ` ] [ array ]
300
+ - ` result ` : [ ` <Iterable > ` ] [ iterable ]
301
301
302
302
Non-blocking synchronous map
303
303
@@ -332,6 +332,8 @@ Create an AsyncIterator instance
332
332
333
333
#### async AsyncIterator.prototype.reduce(reducer, initialValue)
334
334
335
+ #### async AsyncIterator.prototype.reduceRight(reducer, initialValue)
336
+
335
337
#### async AsyncIterator.prototype.some(predicate, thisArg)
336
338
337
339
#### async AsyncIterator.prototype.someCount(predicate, count, thisArg)
@@ -366,6 +368,8 @@ Create an AsyncIterator instance
366
368
367
369
#### AsyncIterator.prototype.enumerate()
368
370
371
+ #### AsyncIterator.prototype.reverse()
372
+
369
373
### collect(expected)
370
374
371
375
- ` expected ` : [ ` <number> ` ] [ number ] |[ ` <string[]> ` ] [ string ]
@@ -867,6 +871,7 @@ Set timeout for asynchronous function execution
867
871
- Timur Shemsedinov (marcusaurelius)
868
872
- See github for full [ contributors list] ( https://github.com/metarhia/metasync/graphs/contributors )
869
873
874
+ [ iterable ] : https://tc39.es/ecma262/#sec-iterable-interface
870
875
[ asynciterable ] : https://tc39.github.io/ecma262/#sec-asynciterable-interface
871
876
[ asynciterator ] : #class-asynciterator
872
877
[ collector ] : #class-collector
0 commit comments