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

Display type correctly for array if obj passed as an array #1394

merged 2 commits into from Feb 14, 2023


Copy link

If we pass an array instead of an object in the JSON file.
It throws an error like this; Data must be an object. Found object. which makes no sense.

This happens because typeof operator returns 'object' if you pass an array as an operand.

So, we should use Array.isArray to determine whether the passed value is an array instead of using typeof operator. We can use typeof as a fallback.

Copy link

Thank you!

@typicode typicode merged commit e371afd into typicode:master Feb 14, 2023
Copy link

The merge of this pull request seems to break the CI workflow:

It should probably be adjusted or reverted.

typicode pushed a commit that referenced this pull request Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants