From a63bb8affe39b733af4efdfb79134a1893063cbd Mon Sep 17 00:00:00 2001 From: atlowChemi Date: Sun, 21 May 2023 13:59:41 +0300 Subject: [PATCH] stream: deprecate asIndexedPairs --- doc/api/deprecations.md | 15 +++++++++++++++ doc/api/stream.md | 7 ++++++- lib/internal/streams/operators.js | 3 ++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index d26d62a2c14dd0..c040eac74c3539 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3378,6 +3378,20 @@ In a future version of Node.js, [`assert.CallTracker`][], will be removed. Consider using alternatives such as the [`mock`][] helper function. +### DEP0174: the `readable.asIndexedPairs` class + + + +Type: Runtime + +In a future version of Node.js, [`readable.asIndexedPairs`][], +will be removed. + [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 [RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4 @@ -3470,6 +3484,7 @@ Consider using alternatives such as the [`mock`][] helper function. [`process.mainModule`]: process.md#processmainmodule [`punycode`]: punycode.md [`readable.readableEnded`]: stream.md#readablereadableended +[`readable.asIndexedPairs`]: stream.md#readableasindexedpairsoptions [`request.abort()`]: http.md#requestabort [`request.connection`]: http.md#requestconnection [`request.destroy()`]: http.md#requestdestroyerror diff --git a/doc/api/stream.md b/doc/api/stream.md index 4b204da5e8df51..66d855fed51426 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2453,9 +2453,14 @@ await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2] added: - v17.5.0 - v16.15.0 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/48102 + description: the `asIndexedPairs` property has been deprecated and will be + removed in a future version. --> -> Stability: 1 - Experimental +> Stability: 0 - Deprecated * `options` {Object} * `signal` {AbortSignal} allows destroying the stream if the signal is diff --git a/lib/internal/streams/operators.js b/lib/internal/streams/operators.js index 65c87d6e456bdf..343f36adf4e966 100644 --- a/lib/internal/streams/operators.js +++ b/lib/internal/streams/operators.js @@ -23,6 +23,7 @@ const { addAbortSignalNoValidate, } = require('internal/streams/add-abort-signal'); const { isWritable, isNodeStream } = require('internal/streams/utils'); +const { deprecate } = require('internal/util'); const { ArrayPrototypePush, @@ -420,7 +421,7 @@ function take(number, options = undefined) { } module.exports.streamReturningOperators = { - asIndexedPairs, + asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs is deprecated.', 'DEP0174'), drop, filter, flatMap,