Skip to content

Commit 4d04d3c

Browse files
committed
[Fix] correctly extract save function from fulfilled result value
The previous code incorrectly destructured `doSave` from the PromiseFulfilledResult, but `doSave` doesn't exist there. The actual structure is result.value.save.
1 parent fb74dd9 commit 4d04d3c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

bin.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,14 @@ Promise.all([
336336
(x) => x.status,
337337
);
338338

339-
await fulfilled.reduce(async (prev, { doSave, value: { output } }) => {
339+
await fulfilled.reduce(async (prev, result) => {
340340
await prev;
341+
if (result.status !== 'fulfilled') {
342+
return;
343+
}
344+
const { value } = result;
345+
const { output } = value;
346+
const doSave = 'save' in value ? value.save : undefined;
341347

342348
output.forEach((line) => {
343349
console.log(line);

0 commit comments

Comments
 (0)