MCPcopy Index your code
hub / github.com/caolan/nodeunit / _filter

Function _filter

deps/async.js:201–220  ·  view source on GitHub ↗
(eachfn, arr, iterator, callback)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

_mapFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…