Open brunnerh opened 5 years ago
PR welcome. For the one that wants to work on this, you need to update the readme, the TypeScript definitions, and add tests.
PR welcome. For the one that wants to work on this, you need to update the readme, the TypeScript definitions, and add tests.
Since official support for BigInt
s in Node.js comes from v10.4.0 and at the moment support for it is not the best (what about Math
functions?), should this be postponed at least until Node 8 goes EOL? (2019-12-31)
If not, should we use something along the lines of big-integer to provide support for them (which anyway doesn't solve the Math.log
issue)?
Alternatively to waiting, just add { "engines" : { "node" : ">=10.4.0" } }
to package.json
for the new version.
The function
Number.isFinite
returnsfalse
for all arguments of typebigint
. So the formatting function throws immediately. It would be helpful ifbigint
would be supported as well. I would like to use it with Node'sfs.stat
, which now can returnbigint
values for file sizes.(I tested how the function would behave without the check, and unfortunately the
Math
functions do not supportbigint
arguments:Cannot convert a BigInt value to a number
atMath.log
)