You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default value for objectMode is false. However, when multiple transforms are used, and the previous transform uses objectMode: true, the next one should default to true instead. For example:
This enables creating re-usable transforms that work regardless of whether the previous transform is in objectMode or not. We already use internally some of those objectMode-agnostic transforms, which work regardless of whether chunks are objects or not, and that should keep the objectMode as is. Without the above behavior, every transform must choose either true or false for objectMode and cannot be truly agnostic to it.
The text was updated successfully, but these errors were encountered:
Transforms can return objects by setting
objectMode: true
.The default value for
objectMode
isfalse
. However, when multiple transforms are used, and the previous transform usesobjectMode: true
, the next one should default totrue
instead. For example:otherTransform
should be inobjectMode
since the previous does. It can still revert to non-objectMode
by doing:This enables creating re-usable transforms that work regardless of whether the previous transform is in
objectMode
or not. We already use internally some of thoseobjectMode
-agnostic transforms, which work regardless of whether chunks are objects or not, and that should keep theobjectMode
as is. Without the above behavior, every transform must choose eithertrue
orfalse
forobjectMode
and cannot be truly agnostic to it.The text was updated successfully, but these errors were encountered: