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

Function _filter

examples/browser/nodeunit.js:694–713  ·  view source on GitHub ↗
(eachfn, arr, iterator, callback)

Source from the content-addressed store, hash-verified

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

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…