mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
stream: deprecate asIndexedPairs
PR-URL: https://github.com/nodejs/node/pull/48102 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
1 parent
e88c079022
commit
585d62848e
3 files changed
+7
-3
No files matched your search
@@ -2431,6 +2431,11 @@ await Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2]
|
||||
|
||||
<!-- YAML
|
||||
added: v17.5.0
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/48102
|
||||
description: Using the `asIndexedPairs` method emits a runtime warning that
|
||||
it will be removed in a future version.
|
||||
-->
|
||||
|
||||
> Stability: 1 - Experimental
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user