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

Support for Symbols #64

Closed
titanism opened this issue Dec 6, 2022 · 1 comment
Closed

Support for Symbols #64

titanism opened this issue Dec 6, 2022 · 1 comment

Comments

@titanism
Copy link

titanism commented Dec 6, 2022

Similar to #41 we could add support for Symbols via toString and is-symbol.

> const safeStringify = require('fast-safe-stringify')
undefined
> safeStringify({ foo: 'bar', [Symbol.for('axe.silent')]: true });
'{"foo":"bar"}'
> safeStringify({ foo: 'bar', [Symbol.for('axe.silent').toString()]: true });
'{"foo":"bar","Symbol(axe.silent)":true}'
@titanism
Copy link
Author

titanism commented Dec 6, 2022

Closing as it looks like the PR for #48 was rejected because it's not 1:1 parity with JSON.stringify (which would apply same discussion here).

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