BigInt not supported but it has been since v4
dan-online opened this issue · comments
DanCodes commented
Node 16.0.0
Serialize-Javascript 6.0.0
Typescript 4.3.4
I ran into this error today, my first idea is that "BigInt" is weird because I'm using typescript?
Example data: { big: BigInt(0) }
Error:
str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);
^
TypeError: Do not know how to serialize a BigInt
DanCodes commented
This repo seems quiet so I'll just post why and close:
Because big
is nested in an object, it doesn't go deeper and so BigInt is never serialized