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

Do not parse if data is already object #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kanasite
Copy link

@kanasite kanasite commented Mar 25, 2020

@PCreations I encountered this error Uncaught SyntaxError: Unexpected token o in JSON at position 1 for certain situation, it turns out that data is already an object hence parsing twice causes the error

@ghost
Copy link

ghost commented Mar 25, 2020

Congratulations 🍻. DeepCode analyzed your code in 0.204 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues.


☺️ If you want to provide feedback on our bot, here is how to contact us.

Copy link
Owner

@PCreations PCreations left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch ! We might want to add a unit test with a "data" being an object to test this though.

@kanasite
Copy link
Author

@PCreations I'm not very familiar with jest, looking at the existing test case, would you recommend or help with that?

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

2 participants