(eachfn, arr, iterator, callback)
| 199 | async.foldr = async.reduceRight; |
| 200 | |
| 201 | var _filter = function (eachfn, arr, iterator, callback) { |
| 202 | var results = []; |
| 203 | arr = _map(arr, function (x, i) { |
| 204 | return {index: i, value: x}; |
| 205 | }); |
| 206 | eachfn(arr, function (x, callback) { |
| 207 | iterator(x.value, function (v) { |
| 208 | if (v) { |
| 209 | results.push(x); |
| 210 | } |
| 211 | callback(); |
| 212 | }); |
| 213 | }, function (err) { |
| 214 | callback(_map(results.sort(function (a, b) { |
| 215 | return a.index - b.index; |
| 216 | }), function (x) { |
| 217 | return x.value; |
| 218 | })); |
| 219 | }); |
| 220 | }; |
| 221 | async.filter = doParallel(_filter); |
| 222 | async.filterSeries = doSeries(_filter); |
| 223 | // select alias |
nothing calls this directly
no test coverage detected
searching dependent graphs…