Rename peak() to peek() in IReaderBase with backward compatibility#10
Merged
Rename peak() to peek() in IReaderBase with backward compatibility#10
peak() to peek() in IReaderBase with backward compatibility#10Conversation
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rename
Rename Jul 25, 2025
IReaderBase.peak() to peek()peak() to peek() in IReaderBase with backward compatibility
streamich
requested changes
Jul 25, 2025
src/buffers/Reader.ts
Outdated
| } | ||
|
|
||
| /** | ||
| * Get current byte value without advancing the cursor. |
Collaborator
There was a problem hiding this comment.
Move this description over to peek().
Contributor
Author
There was a problem hiding this comment.
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])); | ||
|
|
Collaborator
There was a problem hiding this comment.
Remove whitespace inside a single unit test.
Contributor
Author
There was a problem hiding this comment.
Done. Removed the empty line in the test case. Commit: 59343e1
streamich
requested changes
Jul 25, 2025
Collaborator
streamich
left a comment
There was a problem hiding this comment.
- 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>
Contributor
Author
Done. Formatted codebase with |
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
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.