Closed pbricout closed 1 year ago
It is arguable whether we want to automatically truncate the values like in some other cases, but I think it is better to notify the user that something is wrong rather than automagically trying to fix the value.
Maybe we should also update the documentation to specify that failing to meet this requirement will throw.
Hey @Zazama do you mind having a look at this PR? Thanks.
Sounds reasonable, kind of interesting to learn that there is no normal int type in js. I think the documentation is clear like this
The documentation does not specify that the
timeStamp
values must be an integer. When the values are not an integer theappendNumber
function silently omit to write the value and creates an invalid encoded buffer.timeStamp
must be a positive integerappendNumber
function to throw aRangeError
when the given value is not an integer instead of creating an invalid bufferfixes #146