Support non-JSON values
Closed this issue · 7 comments
alexkuz commented
The extension serializes state with jsan
, losing values like undefined
or function
.
The way to fix this is to use node-stringify
/ eval
, instead of jsan.stringify
/ jsan.parse
.
(there is probably a better option than eval
, I'm not sure) :)
zalmoxisus commented
I guess node-stringify
will not support circular references. Before jsan
we've also used circular-json
and json-stringify-safe
, but jsan
seems to be faster than competitors.
I think we better add that in jsan
as @kolodny uses our extension and will accept a PR (?)
alexkuz commented
Oh, that seems better, indeed.
kolodny commented
@zalmoxisus @alexkuz I wrote a helper function to do this, let me know if it solves your use case
zalmoxisus commented
alexkuz commented
@zalmoxisus thank you!
zalmoxisus commented
zalmoxisus commented
Should work well now. Thanks to everybody for working on this!