lib/streams.js
function concatStream(list) {
  list = list.map(toStream);
  const transform = transformWithCancel(async function(reason) {
    await Promise.all(transforms.map(stream => cancel(stream, reason)));
  });
  let prev = Promise.resolve();
  const transforms = list.map((stream, i) => transformPair(stream, (readable, writable) => {
    prev = prev.then(() => pipe(readable, transform.writable, {
      preventClose: i !== list.length - 1
    }));
    return prev;
  }));
  return transform.readable;
}
function concatStream(list) {
  list = list.map(toStream);
  const transform = transformWithCancel(async function(reason) {
    await Promise.all(transforms.map(stream => cancel(stream, reason)));
  });
  let prev = Promise.resolve();
  const transforms = list.map((stream, i) => transformPair(stream, (readable, writable) => {
    prev = prev.then(() => pipe(readable, transform.writable, {
      preventClose: i !== list.length - 1
    }));
    return prev;
  }));
  return transform.readable;
}
function concatStream ( list ) { list = list . map ( toStream ) ; const transform = transformWithCancel ( async function ( reason ) { await Promise . all ( transforms . map ( stream => cancel ( stream , reason ) ) ) ; } ) ; let prev = Promise . resolve ( ) ; const transforms = list . map ( ( stream , i ) => transformPair ( stream , ( readable , writable ) => { prev = prev . then ( ( ) => pipe ( readable , transform . writable , { preventClose : i !== list . length - 1 } ) ) ; return prev ; } ) ) ; return transform . readable ; }
Concat a list of Streams
@param {Array<ReadableStream|Uint8array|String>} list  Array of Uint8Arrays/Strings/Streams to concatenate
@returns {ReadableStream} Concatenated list
Concat a list of Streams