-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
console: allow per-stream inspectOptions option
#60082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
We (correctly) allow different streams to be specified for `stdout` and `stderr`, so we should also allow different inspect options for these streams.
24ddc86 to
dc89673
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60082 +/- ##
==========================================
- Coverage 88.45% 88.43% -0.03%
==========================================
Files 703 703
Lines 207797 207808 +11
Branches 40021 40022 +1
==========================================
- Hits 183807 183767 -40
- Misses 15969 16019 +50
- Partials 8021 8022 +1
🚀 New features to boost your workflow:
|
| [stderr, inspectOptions], | ||
| ]); | ||
|
|
||
| for (const inspectOptions of MapPrototypeValues(inspectOptionsMap)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason not to make it a weakmap? instead of iterating over the values, you can already use stdout/stderr and hardcode the two checks, which would be faster than iterating anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean ... it doesn't matter here, does it? The keys will be kept alive anyway. We could put in the effort to allow either a WeakMap or Map, but I don't think that's an option that provides much benefit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, you're right, since the instance holds a strong reference to the streams, and when the instance goes so does the Map, then a Map is fine.
i'd still suggest hardcoding the two checks rather than a for-of loop and the slow iteration protocol, but nbd either way.
We (correctly) allow different streams to be specified for
stdoutandstderr, so we should also allow different inspect options for these streams.