diff --git a/doc/api/stream.md b/doc/api/stream.md index 9b32801305f078..26328b31c72e27 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -2431,6 +2431,11 @@ await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2] > Stability: 1 - Experimental diff --git a/lib/internal/streams/operators.js b/lib/internal/streams/operators.js index 65c87d6e456bdf..96e2a95476813d 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 will be removed in a future version.'), drop, filter, flatMap, diff --git a/test/parallel/test-stream-iterator-helpers-test262-tests.mjs b/test/parallel/test-stream-iterator-helpers-test262-tests.mjs index 8a153fc2fc283e..2f4f30e14c4cfe 100644 --- a/test/parallel/test-stream-iterator-helpers-test262-tests.mjs +++ b/test/parallel/test-stream-iterator-helpers-test262-tests.mjs @@ -60,8 +60,6 @@ import assert from 'assert'; } // asIndexedPairs/length.js assert.strictEqual(Readable.prototype.asIndexedPairs.length, 0); - // asIndexedPairs/name.js - assert.strictEqual(Readable.prototype.asIndexedPairs.name, 'asIndexedPairs'); const descriptor = Object.getOwnPropertyDescriptor( Readable.prototype, 'asIndexedPairs'