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() method #259

Merged
merged 2 commits into from
May 8, 2024
Merged

jsonify() method #259

merged 2 commits into from
May 8, 2024

Conversation

kearfy
Copy link
Member

@kearfy kearfy commented May 8, 2024

Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.

What is the motivation?

We improved toJSON support in #256 with the slight oversight that native datatypes don't generally have a toJSON method.

What does this change do?

It introduces a jsonify method which effectively JSON stringifies the passed value and then parses it again, allthough it adds typing to it to preserve the type of the passed value and converts them.

We're going with a simple stringify + parse method because we need a bit more time if something custom which would loop through all values recursively could be faster and acurate.

What is your testing strategy?

Transformed the toJSON unit test into jsonify

Is this related to any issues?

Continuation of #256

Have you read the Contributing Guidelines?

@kearfy kearfy merged commit d55dfb2 into main May 8, 2024
3 checks passed
@kearfy kearfy deleted the micha/jsonify-method branch May 8, 2024 13:13
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

Successfully merging this pull request may close these issues.

None yet

1 participant