From 448c2080cedfc10ad178d0ed8b82ed05025d30d1 Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Wed, 24 May 2023 11:27:29 +0300 Subject: [PATCH] stream: remove asIndexedPairs --- doc/api/stream.md | 31 ----------- lib/internal/streams/operators.js | 21 -------- test/parallel/test-stream-asIndexedPairs.mjs | 53 ------------------- ...-stream-iterator-helpers-test262-tests.mjs | 20 ------- 4 files changed, 125 deletions(-) delete mode 100644 test/parallel/test-stream-asIndexedPairs.mjs diff --git a/doc/api/stream.md b/doc/api/stream.md index 8de6b17dc9c674..46cbf7965aebc1 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2447,37 +2447,6 @@ import { Readable } from 'node:stream'; await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2] ``` -##### `readable.asIndexedPairs([options])` - - - -> Stability: 1 - Experimental - -* `options` {Object} - * `signal` {AbortSignal} allows destroying the stream if the signal is - aborted. -* Returns: {Readable} a stream of indexed pairs. - -This method returns a new stream with chunks of the underlying stream paired -with a counter in the form `[index, chunk]`. The first index value is 0 and it -increases by 1 for each chunk produced. - -```mjs -import { Readable } from 'node:stream'; - -const pairs = await Readable.from(['a', 'b', 'c']).asIndexedPairs().toArray(); -console.log(pairs); // [[0, 'a'], [1, 'b'], [2, 'c']] -``` - ##### `readable.reduce(fn[, initial[, options]])`