Skip to content
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

[doc] clarify the edge cases where the input buffer is empty #209

Merged
merged 1 commit into from
May 1, 2022

Conversation

gfx
Copy link
Member

@gfx gfx commented May 1, 2022

As JSON.parse("") raises a SyntaxError, msgpack.decode([]) raises a RangeError. In fact, it always raises RangeError if the input is insufficient.

resolve #198

@codecov-commenter
Copy link

codecov-commenter commented May 1, 2022

Codecov Report

Merging #209 (bebb16b) into main (b17287d) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #209   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files          16       16           
  Lines         964      964           
  Branches      206      206           
=======================================
  Hits          946      946           
  Misses         18       18           
Impacted Files Coverage Δ
src/Decoder.ts 99.16% <ø> (ø)
src/decode.ts 100.00% <ø> (ø)
src/decodeAsync.ts 90.47% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b17287d...bebb16b. Read the comment docs.

@gfx gfx enabled auto-merge May 1, 2022 02:38
@gfx gfx merged commit 32654ee into main May 1, 2022
@gfx gfx deleted the clarify_empty_input branch May 1, 2022 02:41
@gfx
Copy link
Member Author

gfx commented May 1, 2022

On the other hand, decodeMulti*() can decode empty inputs, generating an empty stream or array. 2b66bb7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] decode throws RangeError on empty Uint8Array
2 participants