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

feat!: return null from bytestream when stream closes #158

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

achingbrain
Copy link
Owner

If a required number of bytes is not specified, and the underlying stream closes without yielding any bytes, return null instead of throwing EOF.

BREAKING CHANGE: if the underlying stream closes without yielding any bytes and we are not waiting for a required number of bytes, byteStream.read will now return null instead of an empty Uint8ArrayList

Copy link

codecov bot commented Mar 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.97%. Comparing base (be2275e) to head (db1b24e).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #158      +/-   ##
==========================================
+ Coverage   96.88%   96.97%   +0.08%     
==========================================
  Files         107      107              
  Lines        9761     9782      +21     
  Branches     1474     1482       +8     
==========================================
+ Hits         9457     9486      +29     
+ Misses        304      296       -8     
Flag Coverage Δ
chrome 97.59% <100.00%> (+0.24%) ⬆️
node 96.95% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@achingbrain achingbrain force-pushed the fix/re-throw-error-on-write branch from bc679f6 to fcb6ab1 Compare March 19, 2025 09:56
Base automatically changed from fix/re-throw-error-on-write to main March 19, 2025 09:56

Verified

This commit was signed with the committer’s verified signature.
achingbrain Alex Potsides
If a required number of bytes is not specified, and the underlying
stream closes without yielding any bytes, return `null` instead of
throwing `EOF`.

BREAKING CHANGE: if the underlying stream closes without yielding any bytes and we are not waiting for a required number of bytes, `byteStream.read` will now return `null` instead of an empty `Uint8ArrayList`

Verified

This commit was signed with the committer’s verified signature.
achingbrain Alex Potsides
@achingbrain achingbrain force-pushed the fix/return-null-from-closed-bytestream branch from 2b87067 to db1b24e Compare March 19, 2025 09:57
@achingbrain achingbrain merged commit df88a9d into main Mar 19, 2025
4 checks passed
@achingbrain achingbrain deleted the fix/return-null-from-closed-bytestream branch March 19, 2025 09:57
github-actions bot pushed a commit that referenced this pull request Mar 19, 2025
## [it-byte-stream-v2.0.0](it-byte-stream-1.1.1...it-byte-stream-2.0.0) (2025-03-19)

### ⚠ BREAKING CHANGES

* if the underlying stream closes without yielding any bytes and we are not waiting for a required number of bytes, `byteStream.read` will now return `null` instead of an empty `Uint8ArrayList`
* the `AbortOptions` interface is no longer exported, use the one from `abort-error` instead

### Features

* return null from bytestream when stream closes ([#158](#158)) ([df88a9d](df88a9d))

### Bug Fixes

* remove AbortOptions exports ([#156](#156)) ([34b18fb](34b18fb))
Copy link

🎉 This PR is included in version it-byte-stream-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 19, 2025
## [it-length-prefixed-stream-v2.0.0](it-length-prefixed-stream-1.2.1...it-length-prefixed-stream-2.0.0) (2025-03-19)

### ⚠ BREAKING CHANGES

* if the underlying stream closes without yielding any bytes and we are not waiting for a required number of bytes, `byteStream.read` will now return `null` instead of an empty `Uint8ArrayList`
* the `AbortOptions` interface is no longer exported, use the one from `abort-error` instead

### Features

* return null from bytestream when stream closes ([#158](#158)) ([df88a9d](df88a9d))

### Bug Fixes

* remove AbortOptions exports ([#156](#156)) ([34b18fb](34b18fb))
Copy link

🎉 This PR is included in version it-length-prefixed-stream-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

1 participant