Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for complex Map key types #35

Closed
Skn0tt opened this issue Jul 30, 2020 · 1 comment
Closed

Add support for complex Map key types #35

Skn0tt opened this issue Jul 30, 2020 · 1 comment

Comments

@Skn0tt
Copy link
Collaborator

Skn0tt commented Jul 30, 2020

Currently, SuperJSON is unable to serialise Map { /a/g => foo } or any other key type that's compared by reference. This is because there can be serialisability conflicts:

m = new Map()
m.set(/a/g, 1)
m.set(/a/g, 1)
m // Map { /a/g => 1, /a/g => 1 }

/* How do you serlialize this? */

Some other things that need to be accounted for when extending SuperJSON to serialise reference-compared values:

  • referential equality to other values and keys needs to be persisted (e.g. added to referentialEqualities)
  • what about reference cycles contained in a key?
@Skn0tt
Copy link
Collaborator Author

Skn0tt commented Aug 11, 2020

Closed by #37

@Skn0tt Skn0tt closed this as completed Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant