big.js
big.js copied to clipboard
Nullish input of Big constructor results in Error
For example, using Big(null)
will cause Error: [big.js] Invalid number
while it is common that I can't make sure if the input is not nullish value.
I suggest that Big(null)
returns value zero and it logs warning in dev mode.
ref: https://github.com/MikeMcl/big.js/blob/master/big.mjs#L138
IMO not a good idea. BigInt
, which is newer than Number
, throws error: https://github.com/tc39/proposal-bigint/issues/15