-
-
Notifications
You must be signed in to change notification settings - Fork 2
Rename peak() to peek() in IReaderBase with backward compatibility
#10
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
Conversation
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
IReaderBase.peak() to peek()peak() to peek() in IReaderBase with backward compatibility
src/buffers/Reader.ts
Outdated
| } | ||
|
|
||
| /** | ||
| * Get current byte value without advancing the cursor. |
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.
Move this description over to peek().
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.
Done. Moved the JSDoc description to the peek() method and kept only the deprecation notice on peak(). Commit: 59343e1
| test('peak() returns current byte without advancing cursor', () => { | ||
| const reader = new Reader(); | ||
| reader.reset(new Uint8Array([1, 2, 3, 4, 5])); | ||
|
|
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.
Remove whitespace inside a single unit test.
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.
Done. Removed the empty line in the test case. Commit: 59343e1
streamich
left a comment
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.
- When done, run
yarn prettierto reformat the codebase. - Use Angular style commits
feat: <msg>.
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Done. Formatted codebase with |
streamich
left a comment
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.
LGTM
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR addresses the misspelling of the
peak()method inIReaderBaseand its implementing classes by introducing the correctly spelledpeek()method while maintaining full backward compatibility.Changes Made
Interface Updates
peek()method toIReaderBaseinterface with proper JSDoc documentationpeak()method as@deprecatedwith migration guidanceImplementation Updates
Updated all classes that implement the interface:
ReaderclassStreamingReaderclassStreamingOctetReaderclassEach implementation:
peek()method with the actual implementationpeak()method to a deprecated wrapper that delegates topeek()Example Usage
Testing
Backward Compatibility
peak()continues to work unchangedpeak()with migration guidanceFixes #6.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.