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

What is the difference between devalue and superjson? #75

Open
martinszeltins opened this issue Jan 29, 2024 · 1 comment
Open

What is the difference between devalue and superjson? #75

martinszeltins opened this issue Jan 29, 2024 · 1 comment

Comments

@martinszeltins
Copy link

I know this is not an "issue" but I don't understand what exactly is the difference between these 2 packages. Which is is better because they seem to do very similar things 😕

@controversial
Copy link

Functionality difference: superjson supports more types of values out of the box (e.g. classes, symbols, Errors, TypedArrays) that devalue doesn’t support

Safety difference: superjson ignores values it doesn’t support, silently excluding them from the output, whereas devalue throws an error. Erroring is probably better for type safety and predictable behavior, because you’ll be able to notice the error and add a custom replacer

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

2 participants