1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-04 01:59:15 +02:00

Beef up unit test coverage in io package.

This commit is contained in:
Jeff Schiller 2023-11-20 22:44:41 -08:00
parent 5c4a085292
commit 2ed482879f
8 changed files with 164 additions and 25 deletions

View file

@ -84,13 +84,13 @@ export class BitBuffer {
if (this.bytePtr >= this.data.byteLength) {
throw `No more bytes left when switching packing direction`;
}
this.bitPtr = 7;
this.bitPtr = 0;
} else if (!this.mtl && this.bitPtr !== 0) {
this.bytePtr++;
if (this.bytePtr >= this.data.byteLength) {
throw `No more bytes left when switching packing direction`;
}
this.bitPtr = 0;
this.bitPtr = 7;
}
}