Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}, 0);
let currentIdx = -1;
const nextStream = () => {
currentIdx += 1;
if (currentIdx === uploads.length) return null;
const chunk = uploads[currentIdx];
if (chunk.bytes) {
return intoStream(chunk.bytes);
} else if (chunk.file) {
return fs.createReadStream(chunk.file);
} else {
throw new Error("not implemented");
}
};
const stream = new StreamConcat(nextStream);
return { contentLength, stream };
});
}