Skip to content

Commit c16967a

Browse files
committed
fixup! stream: rename Duplex.toWeb() type option to readableType
1 parent c4fdc85 commit c16967a

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

doc/api/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4388,6 +4388,21 @@ import { opendir } from 'node:fs/promises';
43884388
}
43894389
```
43904390
4391+
### DEP0201: Passing `options.type` to `Duplex.toWeb()`
4392+
4393+
<!-- YAML
4394+
changes:
4395+
- version: REPLACEME
4396+
pr-url: https://github.com/nodejs/node/pull/61632
4397+
description: Documentation-only deprecation.
4398+
-->
4399+
4400+
Type: Documentation-only
4401+
4402+
Passing the `type` option to [`Duplex.toWeb()`][] is deprecated. To specify the
4403+
type of the readable half of the constructed readable-writable pair, use the
4404+
`readableType` option instead.
4405+
43914406
[DEP0142]: #dep0142-repl_builtinlibs
43924407
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
43934408
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
@@ -4406,6 +4421,7 @@ import { opendir } from 'node:fs/promises';
44064421
[`Buffer.isBuffer()`]: buffer.md#static-method-bufferisbufferobj
44074422
[`Cipheriv`]: crypto.md#class-cipheriv
44084423
[`Decipheriv`]: crypto.md#class-decipheriv
4424+
[`Duplex.toWeb()`]: stream.md#streamduplextowebstreamduplex-options
44094425
[`Error.isError`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError
44104426
[`REPLServer.clearBufferedCommand()`]: repl.md#replserverclearbufferedcommand
44114427
[`ReadStream.open()`]: fs.md#class-fsreadstream

doc/api/stream.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3401,7 +3401,8 @@ added: v17.0.0
34013401
changes:
34023402
- version: REPLACEME
34033403
pr-url: https://github.com/nodejs/node/pull/61632
3404-
description: The 'type' option is renamed to 'readableType'.
3404+
description: Added the 'readableType' option to specify the ReadableStream
3405+
type. The 'type' option is deprecated.
34053406
- version: v25.4.0
34063407
pr-url: https://github.com/nodejs/node/pull/58664
34073408
description: Added the 'type' option to specify the ReadableStream type.
@@ -3416,6 +3417,7 @@ changes:
34163417
* `options` {Object}
34173418
* `readableType` {string} Specifies the type of the `ReadableStream` half of
34183419
the created readable-writable pair. Must be `'bytes'` or undefined.
3420+
(`options.type` is a deprecated alias for this option.)
34193421
* Returns: {Object}
34203422
* `readable` {ReadableStream}
34213423
* `writable` {WritableStream}

lib/internal/webstreams/adapters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ function newReadableWritablePairFromDuplex(duplex, options = kEmptyObject) {
643643

644644
const readableOptions = {
645645
__proto__: null,
646-
// 'options.type' is a legacy alias for 'options.readableType'
646+
// DEP0201: 'options.type' is a deprecated alias for 'options.readableType'
647647
type: options.readableType ?? options.type,
648648
};
649649

0 commit comments

Comments
 (0)