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

toJSONTag should conform to toJSON method #10

Closed
poef opened this issue Feb 26, 2025 · 1 comment
Closed

toJSONTag should conform to toJSON method #10

poef opened this issue Feb 26, 2025 · 1 comment

Comments

@poef
Copy link
Member

poef commented Feb 26, 2025

toJSON() is defined such that you return a value, which is then given to JSON.stringify(), it does not return a string.

toJSONTag() now returns a string, which should be valid JSONTag, but there is no check.
Instead it should return a value, just like toJSON(), and JSONTag should then stringify() it. This way, the result will always be valid JSONTag.

In addition, the default toJSONTag() functions expect toJSON() to return a string, which is incorrect.

@poef
Copy link
Member Author

poef commented Feb 26, 2025

Solved in release 0.9.11

@poef poef closed this as completed Feb 26, 2025
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