Comments (4)
@rvagg, @isaacs I'm happy to look in to this and submit a PR.
Can you please confirm that sending stream.write(undefined)
, stream.write(null)
and calling stream.end()
should all end a Transform
stream in the same way?
Is this the same behaviour for objectMode:true
and objectMode:false
?
ref: https://github.com/isaacs/readable-stream/blob/master/test/simple/test-stream2-transform.js#L453
from node.
Can you please confirm that sending stream.write(undefined), stream.write(null) and calling stream.end() should all end a Transform stream in the same way?
stream.write(null | undefined)
should not end a stream -- the null
EOF is only triggered through the readable's internal_-ish_ .push
method.
It's down to this line -- specifically the isNull
check. This sits at a weird place on the "bug or normal behavior" spectrum: without the check, all of the tests still pass, and in objectMode one would expect any value written to the stream to be transformed, but as it stands, in most cases null
is an "out of alphabet" value for streams and represents the end of a stream.
(Tangentially, I'd love to move away from null
-as-EOF in the future for this (and other) reasons.)
from node.
I agree since it always feels weird to me calling .push(null)
when ending a readable stream.
from node.
I'm closing this as the question was answered and there doesn't appear to be anything else immediately actionable here. Please feel free to re-open it if you disagree.
from node.
Related Issues (20)
- Migrate ESLint config to flat config
- NodeJS Crash AWS Lambda v20 HOT 6
- Getting EINVAL error on Windows upon NPM execution after node.js update to 20.12.2 HOT 4
- unhandledRejection Error [ERR_INTERNAL_ASSERTION] HOT 5
- Remove --experimental-policy HOT 24
- IORedis causing node internal issue HOT 2
- UNABLE_TO_VERIFY_LEAF_SIGNATURE/unable to verify the first certificate error HOT 3
- `fs.openAsBlob()` does not work properly for files > 2GB HOT 7
- Appending Contents Using ">>" to Non-Existent .js File in Powershell Results in Unexecutable File HOT 4
- Test runner: spec reporter abridges diff on `deepEqual` / `deepStrictEqual` assertion failure HOT 1
- [invalid defect] Cannot exit all the processes when `CTRL + C` in readline HOT 4
- Provide some mechanism to conditionally and synchronously import modules (or just builtins) from ESM HOT 8
- v8::internal::TranslatedState::CreateNextTranslatedValue(int, v8::internal::TranslationArrayIterator*, v8::internal::DeoptimizationLiteralArray, unsigned long, v8::internal::RegisterValues*, _IO_FILE*) [/var/lang/bin/node] HOT 3
- Not possible to know when fs.watch has started on macOS
- VM Context doesn't reflect root-level variable declarations HOT 1
- Segfault on non-x86_64 architectures
- Comment field on `crypto.generateKeyPair` HOT 2
- WASI stdio (stdin, stdout) API not very useful HOT 4
- Wrong gpg key in docs HOT 2
- stream pipeline kills process when writeStream is closed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node.