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

Jsonify problems #407

Closed
frontsideair opened this issue Jun 25, 2022 · 1 comment · Fixed by #410
Closed

Jsonify problems #407

frontsideair opened this issue Jun 25, 2022 · 1 comment · Fixed by #410
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@frontsideair
Copy link
Contributor

frontsideair commented Jun 25, 2022

I mentioned in #406 that I was building my own Jsonify. I have a small test suite that I based on the spec and there's a simplified version on MDN.

I put the definition in here and it fails a few cases, namely these:

  • Number, String and Boolean should be turned into primitives
  • undefined, Function and symbol should make keys to be omitted if they are values in an object
  • Function and symbol in an array should turn into null
  • symbol keys should be omitted in an object

I can help with these if it aligns with the project goals. My plan would be first add these tests, then fix the current definition to make the tests pass. My current implementation passes the tests, but is not exhaustively tested and it's not as modular as the one in this repo, so I would rather improve this implementation.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@sindresorhus
Copy link
Owner

I'm happy to see the Jsonify type become more correct. Pull request welcome :)

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants