Skip to content

Commit bbbdff5

Browse files
committed
stream: deprecate asIndexedPairs
1 parent 260092e commit bbbdff5

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

doc/api/deprecations.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,6 +3378,20 @@ In a future version of Node.js, [`assert.CallTracker`][],
33783378
will be removed.
33793379
Consider using alternatives such as the [`mock`][] helper function.
33803380

3381+
### DEP0174: the `readable.asIndexedPairs` method
3382+
3383+
<!-- YAML
3384+
changes:
3385+
- version: REPLACEME
3386+
pr-url: https://github.com/nodejs/node/pull/48102
3387+
description: Runtime deprecation.
3388+
-->
3389+
3390+
Type: Runtime
3391+
3392+
In a future version of Node.js, [`readable.asIndexedPairs`][],
3393+
will be removed.
3394+
33813395
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
33823396
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
33833397
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3469,6 +3483,7 @@ Consider using alternatives such as the [`mock`][] helper function.
34693483
[`process.getActiveResourcesInfo()`]: process.md#processgetactiveresourcesinfo
34703484
[`process.mainModule`]: process.md#processmainmodule
34713485
[`punycode`]: punycode.md
3486+
[`readable.asIndexedPairs`]: stream.md#readableasindexedpairsoptions
34723487
[`readable.readableEnded`]: stream.md#readablereadableended
34733488
[`request.abort()`]: http.md#requestabort
34743489
[`request.connection`]: http.md#requestconnection

doc/api/stream.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,9 +2453,14 @@ await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2]
24532453
added:
24542454
- v17.5.0
24552455
- v16.15.0
2456+
changes:
2457+
- version: REPLACEME
2458+
pr-url: https://github.com/nodejs/node/pull/48102
2459+
description: the `asIndexedPairs` property has been deprecated and will be
2460+
removed in a future version.
24562461
-->
24572462

2458-
> Stability: 1 - Experimental
2463+
> Stability: 0 - Deprecated
24592464
24602465
* `options` {Object}
24612466
* `signal` {AbortSignal} allows destroying the stream if the signal is

lib/internal/streams/operators.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const {
2323
addAbortSignalNoValidate,
2424
} = require('internal/streams/add-abort-signal');
2525
const { isWritable, isNodeStream } = require('internal/streams/utils');
26+
const { deprecate } = require('internal/util');
2627

2728
const {
2829
ArrayPrototypePush,
@@ -420,7 +421,7 @@ function take(number, options = undefined) {
420421
}
421422

422423
module.exports.streamReturningOperators = {
423-
asIndexedPairs,
424+
asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs is deprecated.', 'DEP0174'),
424425
drop,
425426
filter,
426427
flatMap,

test/parallel/test-stream-iterator-helpers-test262-tests.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ import assert from 'assert';
6060
}
6161
// asIndexedPairs/length.js
6262
assert.strictEqual(Readable.prototype.asIndexedPairs.length, 0);
63-
// asIndexedPairs/name.js
64-
assert.strictEqual(Readable.prototype.asIndexedPairs.name, 'asIndexedPairs');
6563
const descriptor = Object.getOwnPropertyDescriptor(
6664
Readable.prototype,
6765
'asIndexedPairs'

0 commit comments

Comments
 (0)