Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 585d628

Browse filesBrowse files
atlowChemiMoLow
authored andcommitted
stream: deprecate asIndexedPairs
PR-URL: #48102 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
1 parent e88c079 commit 585d628
Copy full SHA for 585d628

File tree

Expand file treeCollapse file tree

3 files changed

+7
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,11 @@ await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2]
24312431

24322432
<!-- YAML
24332433
added: v17.5.0
2434+
changes:
2435+
- version: REPLACEME
2436+
pr-url: https://github.com/nodejs/node/pull/48102
2437+
description: Using the `asIndexedPairs` method emits a runtime warning that
2438+
it will be removed in a future version.
24342439
-->
24352440

24362441
> Stability: 1 - Experimental
Collapse file

‎lib/internal/streams/operators.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/operators.js
+2-1Lines 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 will be removed in a future version.'),
424425
drop,
425426
filter,
426427
flatMap,
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-stream-iterator-helpers-test262-tests.mjs
-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.