Skip to content

Commit 293cbeb

Browse files
committed
Removed unnecessary code checks
1 parent 1d9a044 commit 293cbeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BinaryReader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,11 @@ export class BinaryReader
452452
*/
453453
public readCharBytes(bytesToRead: number, encoding: Encoding): string
454454
{
455-
if (isNaN(bytesToRead) || (typeof bytesToRead !== 'string' && typeof bytesToRead !== 'number')) {
455+
if (isNaN(bytesToRead)) {
456456
throw new InvalidArgumentError('`charactersToRead` is not a number', 'bytesToRead', bytesToRead);
457457
}
458458

459-
bytesToRead = Math.floor(parseFloat(bytesToRead as any));
459+
bytesToRead = Math.floor(bytesToRead);
460460

461461
if (bytesToRead < 1) {
462462
throw new InvalidArgumentError('`charactersToRead` cannot be less than 0', 'bytesToRead', bytesToRead);

0 commit comments

Comments
 (0)