Handle Set serialization
Hey there! 👋🏻
This PR adds a specific case to serialize a Set to a stringable object.
A couple of things.
- If serialization support a data type, then it should be serialized in a consistent manner, regardless of the depth of the data type. That is how other data types are handled too
- The more important one, is to carefully see if there is a common pattern for serializing
SetandMap. Because, we are taking on to serialize a language specific data type to JSON (which is not very common). So, we should follow the due diligence and make sure we are inventing our own way of serializing them
I am not sure we should handle Map since they are pretty different and more complex. You can provide anything as a key, meaning a non-keyable object that cannot be adequately serialized.
I have added @targos test to ensure we can serialize nested sets too.
I saw that the ESM rewrite of this package is now using safe-stable-stringify that does not support Set.
Should we close this PR then and expect people to serialize it themself?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.