GeezerVison is showing github.com — stream: deprecate asIndexedPairs · nodejs/node@9e2b13d
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -2453,6 +2453,11 @@ await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2] |
2453 | 2453 | added: |
2454 | 2454 | - v17.5.0 |
2455 | 2455 | - v16.15.0 |
| 2456 | +changes: |
| 2457 | + - version: REPLACEME |
| 2458 | + pr-url: https://github.com/nodejs/node/pull/48102 |
| 2459 | + description: Using the `asIndexedPairs` method emits a runtime warning that |
| 2460 | + it will be removed in a future version. |
2456 | 2461 | --> |
2457 | 2462 |
|
2458 | 2463 | > Stability: 1 - Experimental |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/streams/operators.js +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -23,6 +23,7 @@ const { |
23 | 23 | addAbortSignalNoValidate, |
24 | 24 | } = require('internal/streams/add-abort-signal'); |
25 | 25 | const { isWritable, isNodeStream } = require('internal/streams/utils'); |
| 26 | +const { deprecate } = require('internal/util'); |
26 | 27 |
|
27 | 28 | const { |
28 | 29 | ArrayPrototypePush, |
@@ -420,7 +421,7 @@ function take(number, options = undefined) { |
420 | 421 | } |
421 | 422 |
|
422 | 423 | module.exports.streamReturningOperators = { |
423 | | - asIndexedPairs, |
| 424 | + asIndexedPairs: deprecate(asIndexedPairs, 'readable.asIndexedPairs will be removed in a future version.'), |
424 | 425 | drop, |
425 | 426 | filter, |
426 | 427 | flatMap, |
|
Collapse file
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 number | Diff line number | Diff line change |
|---|
@@ -60,8 +60,6 @@ import assert from 'assert'; |
60 | 60 | } |
61 | 61 | // asIndexedPairs/length.js |
62 | 62 | assert.strictEqual(Readable.prototype.asIndexedPairs.length, 0); |
63 | | - // asIndexedPairs/name.js |
64 | | - assert.strictEqual(Readable.prototype.asIndexedPairs.name, 'asIndexedPairs'); |
65 | 63 | const descriptor = Object.getOwnPropertyDescriptor( |
66 | 64 | Readable.prototype, |
67 | 65 | 'asIndexedPairs' |
|