Skip to content

Commit 59343e1

Browse files
Copilotstreamich
andcommitted
Move JSDoc description to peek() method and remove whitespace in test
Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
1 parent c019140 commit 59343e1

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/buffers/Reader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ export class Reader implements IReader, IReaderResettable {
1212
this.view = new DataView(uint8.buffer, uint8.byteOffset, uint8.length);
1313
}
1414

15+
/**
16+
* Get current byte value without advancing the cursor.
17+
*/
1518
public peek(): number {
1619
return this.view.getUint8(this.x);
1720
}
1821

1922
/**
20-
* Get current byte value without advancing the cursor.
2123
* @deprecated Use peek() instead.
2224
*/
2325
public peak(): number {

src/buffers/__tests__/peak-peek.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ describe('peak() and peek() methods', () => {
77
test('peak() returns current byte without advancing cursor', () => {
88
const reader = new Reader();
99
reader.reset(new Uint8Array([1, 2, 3, 4, 5]));
10-
1110
expect(reader.x).toBe(0);
1211
expect(reader.peak()).toBe(1);
1312
expect(reader.x).toBe(0); // cursor should not advance

0 commit comments

Comments
 (0)