Skip to content

feat(resolve): resolve Object.values() in PropType.oneOf() #318

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

Merged
merged 1 commit into from
Jan 25, 2019
Merged

feat(resolve): resolve Object.values() in PropType.oneOf() #318

merged 1 commit into from
Jan 25, 2019

Conversation

gatsbimantico
Copy link
Contributor

Adding compatibility for Object.values as suggested on #211

Creates a new util to extract keys from Object.values() and ObjectExpressions when used inside of oneOf()
It also follows spreads and tries to resolve them. Currently it bails out if either a Property is computed and the computed key is not a Literal or if a spread cannot be resolved.

Getters and setters will be ignored and undefined values transform to a null Literal.

Added the tests and checked that passes the test:ci script.

@gatsbimantico
Copy link
Contributor Author

@danez Seems like VSCode and Travis are disagreeing on some prettier rules

@danez danez merged commit c791667 into reactjs:master Jan 25, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants