Interesting post, thanks, and it'd be great to have a common convention for all native constructors that can't be serialized, and these two helpers should already work for most cases (missing recursive parse/stringify for special cases such as Map or Set).
In CircularJSON, differently from flatted, I used the ~ special char to signal recursion, but having a prefix such as \x01, or any other non common chars sequences, might be all it takes to have more portable data structures that can be resumed.
We're a place where coders share, stay up-to-date and grow their careers.
Interesting post, thanks, and it'd be great to have a common convention for all native constructors that can't be serialized, and these two helpers should already work for most cases (missing recursive parse/stringify for special cases such as Map or Set).
Testable via:
In CircularJSON, differently from flatted, I used the
~
special char to signal recursion, but having a prefix such as\x01
, or any other non common chars sequences, might be all it takes to have more portable data structures that can be resumed.