-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
zlib: expose amount of data read for compression/decompression #12939
Conversation
Added bytesRead property to Zlib engines and an option to expose the engine to convenience method callbacks. Fixes: nodejs#8874
It seems like this introduces two different changes, one that does what the PR title says, but there is also a (possible) change in the value passed to callbacks or returned from synchronous methods. I think it would be better to separate out those into separate PRs since the unrelated change would be semver-major IMHO. |
lib/zlib.js
Outdated
if (engine._opts.info) { | ||
return { | ||
buffer: buffer, | ||
engine: engine |
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.
You can just use return { buffer, engine };
here. :)
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.
Good point! Done.
@mscdex I've made an alternative set of pull requests that breaks the changes in two.
(I've closed this pull request in favor of those two different ones.) |
Added bytesRead property to Zlib engines and an option to expose the engine to
convenience method callbacks (so that the bytesRead value can be used in the convenience methods, per related issue).
Fixes: #8874
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
I can try to add documentation later, once I know the API does not need any changes.