lib/streams.js
function concat(list) {
  if (list.some(isStream)) {
    return concatStream(list);
  }
  if (typeof list[0] === 'string') {
    return list.join('');
  }
  if (NodeBuffer && NodeBuffer.isBuffer(list[0])) {
    return NodeBuffer.concat(list);
  }
  return concatUint8Array(list);
}
function concat(list) {
  if (list.some(isStream)) {
    return concatStream(list);
  }
  if (typeof list[0] === 'string') {
    return list.join('');
  }
  if (NodeBuffer && NodeBuffer.isBuffer(list[0])) {
    return NodeBuffer.concat(list);
  }
  return concatUint8Array(list);
}
function concat ( list ) { if ( list . some ( isStream ) ) { return concatStream ( list ) ; } if ( typeof list [ 0 ] === 'string' ) { return list . join ( '' ) ; } if ( NodeBuffer && NodeBuffer . isBuffer ( list [ 0 ] ) ) { return NodeBuffer . concat ( list ) ; } return concatUint8Array ( list ) ; }
Concat a list of Uint8Arrays, Strings or Streams
The caller should not mix Uint8Arrays with Strings, but may mix Streams with non-Streams.
@param {Array<Uint8array|String|ReadableStream>} Array of Uint8Arrays/Strings/Streams to concatenate
@returns {Uint8array|String|ReadableStream} Concatenated array
Concat a list of Uint8Arrays Strings or Streams The caller should not mix Uint8Arrays with Strings but may mix Streams with non - Streams .