There was an error while loading. Please reload this page.
1 parent 1d9a044 commit 293cbebCopy full SHA for 293cbeb
src/BinaryReader.ts
@@ -452,11 +452,11 @@ export class BinaryReader
452
*/
453
public readCharBytes(bytesToRead: number, encoding: Encoding): string
454
{
455
-if (isNaN(bytesToRead) || (typeof bytesToRead !== 'string' && typeof bytesToRead !== 'number')) {
+if (isNaN(bytesToRead)) {
456
throw new InvalidArgumentError('`charactersToRead` is not a number', 'bytesToRead', bytesToRead);
457
}
458
459
-bytesToRead = Math.floor(parseFloat(bytesToRead as any));
+bytesToRead = Math.floor(bytesToRead);
460
461
if (bytesToRead < 1) {
462
throw new InvalidArgumentError('`charactersToRead` cannot be less than 0', 'bytesToRead', bytesToRead);
0 commit comments