Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/generators/ast-js/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@ export default {
async processChunk(inputSlice, itemIndices) {
const filePaths = itemIndices.map(idx => inputSlice[idx]);

return Promise.all(
filePaths.map(async path => parseJsSource(await read(path, 'utf-8')))
);
const results = [];

for (const path of filePaths) {
const vfile = await read(path, 'utf-8');

const parsedJS = await parseJsSource(vfile);

results.push(parsedJS);
}

return results;
},

/**
Expand Down
22 changes: 12 additions & 10 deletions src/generators/ast/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ export default {
async processChunk(inputSlice, itemIndices) {
const filePaths = itemIndices.map(idx => inputSlice[idx]);

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

updateStabilityPrefixToLink(vfile);
for (const path of filePaths) {
const vfile = await read(path, 'utf-8');

return {
tree: remarkProcessor.parse(vfile),
file: { stem: vfile.stem, basename: vfile.basename },
};
})
);
updateStabilityPrefixToLink(vfile);

results.push({
tree: remarkProcessor.parse(vfile),
file: { stem: vfile.stem, basename: vfile.basename },
});
}

return results;
},

/**
Expand Down
Loading