Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const concatStream = createConcatStream((payloadBuffer) => {
resolve(payloadBuffer);
});
const encode = createEncoder();
const tupleStream = new Readable({
objectMode: true,
});
tupleStream
.pipe(encode)
.pipe(concatStream)
.on('error', (error) => {
reject(error);
});
let lastTupleSize;
for (const tuple of tupleList) {
if (typeof lastTupleSize === 'number' && lastTupleSize !== tuple.length) {