(eachfn, arr, iterator, callback)
| 692 | async.foldr = async.reduceRight; |
| 693 | |
| 694 | var _filter = function (eachfn, arr, iterator, callback) { |
| 695 | var results = []; |
| 696 | arr = _map(arr, function (x, i) { |
| 697 | return {index: i, value: x}; |
| 698 | }); |
| 699 | eachfn(arr, function (x, callback) { |
| 700 | iterator(x.value, function (v) { |
| 701 | if (v) { |
| 702 | results.push(x); |
| 703 | } |
| 704 | callback(); |
| 705 | }); |
| 706 | }, function (err) { |
| 707 | callback(_map(results.sort(function (a, b) { |
| 708 | return a.index - b.index; |
| 709 | }), function (x) { |
| 710 | return x.value; |
| 711 | })); |
| 712 | }); |
| 713 | }; |
| 714 | async.filter = doParallel(_filter); |
| 715 | async.filterSeries = doSeries(_filter); |
| 716 | // select alias |
nothing calls this directly
no test coverage detected
searching dependent graphs…