MCPcopy
hub / github.com/tdewolff/minify / asyncSerialArray

Function asyncSerialArray

_benchmarks/sample_antd.js:74800–74821  ·  view source on GitHub ↗
(arr, func, callback)

Source from the content-addressed store, hash-verified

74798}
74799
74800function asyncSerialArray(arr, func, callback) {
74801 var index = 0;
74802 var arrLength = arr.length;
74803
74804 function next(errors) {
74805 if (errors && errors.length) {
74806 callback(errors);
74807 return;
74808 }
74809
74810 var original = index;
74811 index = index + 1;
74812
74813 if (original < arrLength) {
74814 func(arr[original], next);
74815 } else {
74816 callback([]);
74817 }
74818 }
74819
74820 next([]);
74821}
74822
74823function flattenObjArr(objArr) {
74824 var ret = [];

Callers 1

asyncMapFunction · 0.85

Calls 1

nextFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…