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

simplify handling of primitives #10

Merged
merged 1 commit into from
Apr 12, 2018
Merged

simplify handling of primitives #10

merged 1 commit into from
Apr 12, 2018

Conversation

bttmly
Copy link
Collaborator

@bttmly bttmly commented Apr 11, 2018

Resolves #9

Object(x) !== x is a terse idiom for detecting if something is a primitive value

I removed the handling for schema instanceof String since it seems like that case should either be extended to schema instanceof Boolean and schema instanceof Number or removed entirely, with the second option being simpler. Further, there was not a test on it.

If you want the same behavior for undefined without accepting these changes, the added test will pass if you change === null on L48 to == null.

@cainus cainus merged commit b5fd186 into cainus:master Apr 12, 2018
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.

2 participants