MCPcopy Index your code
hub / github.com/developit/microbundle / each

Function each

tools/generate-filesize.js:10–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8const FIXTURES_DIR = `${__dirname}/../test/fixtures`;
9
10const each = fn => arr => {
11 arr = Array.isArray(arr) ? arr : [arr];
12
13 return arr
14 .reduce(
15 (prev, curr, i) => prev.then(() => fn(curr, i, arr.length)),
16 Promise.resolve(),
17 )
18 .then(() => arr);
19};
20
21const dirs = fs
22 .readdirSync(FIXTURES_DIR)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…