Open krlosMata opened 1 year ago
The aim of the PR is not to protect against an invalid input, but to handle correctly the null
in JS.
JS interprets null
as an object
:
> typeof null
`object`
Therefore, the stringifyBigInts
makes another recursion to call itself with null
and the function breaks.
Hence, null
needs to be handle differently.
I understand the stringifyBigInts
as an utility to convert any object that contains bigInts into the same object, but the bigInts converted as strings, an object ready to be converted to a JSON file via JSON.stringify()
.
In the current approachm if that input object a null
, the function breaks. While the JSON.stringify()
works well with null
null
object instringifyBigInts
utils