Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Add expected types to oneOfType warning #198

Merged
merged 1 commit into from
Feb 28, 2019

Conversation

joshalling
Copy link
Contributor

@joshalling joshalling commented Jul 20, 2018

Adds data object to returned error in type checker so that the expected types can be accessed from within oneOfType check. Also, updates the tests slightly.

Fixes #9. Fixes facebook/react#1919.

Adds data object to returned error in checker so that the expected types can be accessed from within oneOfType check. Also, updates the tests slightly.

Fixes facebook#9.
@joshalling joshalling force-pushed the one-of-type-warnings branch 2 times, most recently from 22a6083 to 587cb59 Compare July 21, 2018 05:05
@joshalling joshalling changed the title Add expected types to oneOfType warning (#9) Add expected types to oneOfType warning Jul 21, 2018
@ljharb ljharb merged commit 3910873 into facebook:master Feb 28, 2019
@oliviertassinari
Copy link

❤️

return null;
}
if (checkerResult.data.hasOwnProperty('expectedType')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

for posterity: assuming .data exists, and also calling .hasOwnProperty directly off of an object, caused #369.

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.

4 participants