Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: deprecate asIndexedPairs #48102

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion doc/api/stream.md
Expand Up @@ -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
atlowChemi marked this conversation as resolved.
Show resolved Hide resolved
removed in a future version.
-->

> Stability: 1 - Experimental
> Stability: 0 - Deprecated
atlowChemi marked this conversation as resolved.
Show resolved Hide resolved

* `options` {Object}
* `signal` {AbortSignal} allows destroying the stream if the signal is
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/streams/operators.js
Expand Up @@ -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,
Expand Down Expand Up @@ -420,7 +421,7 @@ function take(number, options = undefined) {
}

module.exports.streamReturningOperators = {
asIndexedPairs,
asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs is deprecated.'),
atlowChemi marked this conversation as resolved.
Show resolved Hide resolved
drop,
filter,
flatMap,
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-stream-iterator-helpers-test262-tests.mjs
Expand Up @@ -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'
Expand Down