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

Object node can return arrays #320

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Conversation

abrenneke
Copy link
Collaborator

@abrenneke abrenneke commented Jan 17, 2024

Inspect the output type of the object node and if it's an array, return a more-appropriate object[] type rather than object. Fixes #305

@abrenneke abrenneke requested a review from codemile January 17, 2024 21:33
Copy link
Collaborator

@codemile codemile left a comment

Choose a reason for hiding this comment

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

Looks fine to me, but be aware that isArray() has edge cases where it can return false for other types of arrays. For example, Int8Array returns false or objects that are iterators.

We probably want to avoid allowing complex types like that anyway and should stick with simple Array objects.

@abrenneke
Copy link
Collaborator Author

Good to know, I really only care about Array arrays here though I think

@abrenneke abrenneke merged commit cd80075 into main Jan 20, 2024
2 checks passed
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.

[Bug]: array node with flatten option doesn't always work
2 participants