Skip to content

Commit 2ffd777

Browse files
committed
fix(async): revert Promise.all refactor
1 parent 06f981e commit 2ffd777

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/generators/ast-js/index.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@ export default {
3636
async processChunk(inputSlice, itemIndices) {
3737
const filePaths = itemIndices.map(idx => inputSlice[idx]);
3838

39-
return Promise.all(
40-
filePaths.map(async path => parseJsSource(await read(path, 'utf-8')))
41-
);
39+
const results = [];
40+
41+
for (const path of filePaths) {
42+
const vfile = await read(path, 'utf-8');
43+
44+
results.push(parseJsSource(vfile));
45+
}
46+
47+
return results;
4248
},
4349

4450
/**

src/generators/ast/index.mjs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ export default {
3838
async processChunk(inputSlice, itemIndices) {
3939
const filePaths = itemIndices.map(idx => inputSlice[idx]);
4040

41-
return Promise.all(
42-
filePaths.map(async path => {
43-
const vfile = await read(path, 'utf-8');
41+
const results = [];
4442

45-
updateStabilityPrefixToLink(vfile);
43+
for (const path of filePaths) {
44+
const vfile = await read(path, 'utf-8');
4645

47-
return {
48-
tree: remarkProcessor.parse(vfile),
49-
file: { stem: vfile.stem, basename: vfile.basename },
50-
};
51-
})
52-
);
46+
updateStabilityPrefixToLink(vfile);
47+
48+
results.push({
49+
tree: remarkProcessor.parse(vfile),
50+
file: { stem: vfile.stem, basename: vfile.basename },
51+
});
52+
}
53+
54+
return results;
5355
},
5456

5557
/**

0 commit comments

Comments
 (0)