Skip to content

Commit 256dcde

Browse files
authored
Update documented return type of toStream (#62)
Document that `toStream` can also return an `ArrayStream`, if one is passed.
1 parent f6e555f commit 256dcde

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/streams.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ import { ArrayStream, Writer } from './writer.js';
44

55
/**
66
* Convert data to Stream
7-
* @param {ReadableStream|Uint8array|String} input data to convert
8-
* @returns {ReadableStream} Converted data
7+
* @param {ReadableStream|ArrayStream|Uint8array|String} input data to convert
8+
* @returns {ReadableStream|ArrayStream} Converted data
99
*/
1010
function toStream(input) {
11-
let streamType = isStream(input);
12-
if (streamType) {
11+
if (isStream(input)) {
1312
return input;
1413
}
1514
return new ReadableStream({

0 commit comments

Comments
 (0)