Allow decompress option for non-deflate compressed entries#81
Closed
overlookmotel wants to merge 1 commit into
Closed
Allow decompress option for non-deflate compressed entries#81overlookmotel wants to merge 1 commit into
overlookmotel wants to merge 1 commit into
Conversation
59b5430 to
03c0996
Compare
Owner
|
Thanks for writing up this PR. I'm inspired to take this seriously, and I've started working on this in a branch (wip). Getting the code working is pretty trivial, as you've demonstrated, but I want to be careful about how this changes the I'm not happy with how complicated things are getting in the docs and the code wrt what cases are allowed and not. I'm considering some kind of api simplification that just asks for the raw data and ignores the compression method and encryption scheme and all that. 🤔 I'll continue working on this tomorrow or sometime soon. |
Owner
|
See #82 |
03c0996 to
5e468b8
Compare
Owner
|
sorry for the 8 year delay. finally fixed in version 3.3.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR for #80.
Currently it is not possible to extract the raw compressed data for entries compressed with a method other than 8 (Deflate).
If you try to open a read stream for an entry compressed with e.g. Deflate64:
decompress: false, you get error "options.decompress can only be specified for compressed entries"decompressoption, you get error "unsupported compression method: 9"This PR alters the treatment of the
decompressoption in.openReadStream()so you can pass optiondecompress: falseand get a stream of the compressed data.Ideally, I think it'd be better to implement this by altering
entry.isCompressed()to useentry.compressionMethod !== 0. ButisCompressed()is part of the public API, so that would be a semver-major change. This PR as it stands would (I think) not.