Skip to content

Commit c92388b

Browse files
committed
Add note regarding null as a reserved value in object mode
1 parent a06f102 commit c92388b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/node_modules/@stdlib/streams/node/from-constant/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ This method accepts the same `options` as [`constantStream()`](#constant-stream)
194194
## Notes
195195

196196
- In binary mode, a provided `value` must be a `string`, `Buffer`, or `Uint8Array`.
197+
- In [`objectMode`][object-mode], `null` is a reserved value. If provided `null`, the returned [stream][stream] will prematurely end.
197198
- If provided an `object` reference, the `value` is **not** copied. To avoid unwanted mutation, copy the `value` **before** creating a [stream][stream].
198199
- In older Node.js environments, `Uint8Array` contents may be copied to a new `Buffer` object due to changes in the underlying Node.js APIs.
199200
- If the `factory` method is provided only one argument and that argument is an `object` (either empty or not containing any recognized `options` properties), the method treats the argument as a value to be streamed, **not** as an `options` argument.

lib/node_modules/@stdlib/streams/node/from-constant/docs/repl.txt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
{{alias}}( value[, options] )
33
Returns a readable stream which always streams the same value.
44

5+
In object mode, `null` is a reserved value. If provided `null`, the
6+
returned stream will prematurely end.
7+
58
Parameters
69
----------
710
value: string|Buffer|Uint8Array|any
@@ -98,6 +101,9 @@
98101
{{alias}}.objectMode( value[, options] )
99102
Returns an "objectMode" readable stream which always streams the same value.
100103

104+
In object mode, `null` is a reserved value. If provided `null`, the
105+
returned stream will prematurely end.
106+
101107
Parameters
102108
----------
103109
value: any

0 commit comments

Comments
 (0)