lib/streams.js
async function pipe(input, target, options) {
  input = toStream(input);
  try {
    if (input[externalBuffer]) {
      const writer = getWriter(target);
      for (let i = 0; i < input[externalBuffer].length; i++) {
        await writer.ready;
        await writer.write(input[externalBuffer][i]);
      }
      writer.releaseLock();
    }
    return await input.pipeTo(target, options);
  } catch(e) {}
}
async function pipe(input, target, options) {
  input = toStream(input);
  try {
    if (input[externalBuffer]) {
      const writer = getWriter(target);
      for (let i = 0; i < input[externalBuffer].length; i++) {
        await writer.ready;
        await writer.write(input[externalBuffer][i]);
      }
      writer.releaseLock();
    }
    return await input.pipeTo(target, options);
  } catch(e) {}
}
async function pipe ( input , target , options ) { input = toStream ( input ) ; try { if ( input [ externalBuffer ] ) { const writer = getWriter ( target ) ; for ( let i = 0 ; i < input [ externalBuffer ] . length ; i ++ ) { await writer . ready ; await writer . write ( input [ externalBuffer ] [ i ] ) ; } writer . releaseLock ( ) ; } return await input . pipeTo ( target , options ) ; } catch ( e ) { } }
Pipe a readable stream to a writable stream. Don't throw on input stream errors, but forward them to the output stream.
@param {ReadableStream|Uint8array|String} input
@param {WritableStream} target
@param {Object} (optional) options
@returns {Promise<undefined>} Promise indicating when piping has finished (input stream closed or errored)
@async
Pipe a readable stream to a writable stream . Don t throw on input stream errors but forward them to the output stream .