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.
This is a reboot of #513
I've added support for the encrypt function to compress messages. You can override the behavior by setting the
compression
parameter in the global config object or the options object passed to the encrypt function.By default, it uses the value from the config which is set to
uncompressed
.NOTE: It looks like a lot of changes for the test. But they are mostly white space indentation changes from using the
withCompression
test helper together with a modification of the arguments to encrypt + verification of the results.Furthermore, instead of exposing a parameter on the decrypted object for the tests (like here https://github.com/openpgpjs/openpgpjs/pull/513/files#diff-eafe30f58aedef3cc702bff70e8917f4R15365), I use spies to check that the compress/decompress functions were called and with the correct parameters. Spying on functions does not work when it's run in the webworker so I had to disable those checks for the webworker.