Skip to content

fix(json schema validator): Replace {} type assertion with type guard #545

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

Conversation

mjc1283
Copy link
Contributor

@mjc1283 mjc1283 commented Jul 30, 2020

Summary

To avoid using the {} type, change json_schema_validator.validate to use a type guard above that will return early when the argument doesn't match that type.

Test plan

Existing tests

@mjc1283 mjc1283 requested a review from a team as a code owner July 30, 2020 17:04
@mjc1283 mjc1283 requested a review from yavorona July 30, 2020 17:04
@mjc1283 mjc1283 removed their assignment Jul 30, 2020
Copy link
Contributor

@yavorona yavorona left a comment

Choose a reason for hiding this comment

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

LGTM!

@yavorona yavorona merged commit ca0a3bc into mcarroll/optimizely-sdk-typescript Jul 30, 2020
@yavorona yavorona deleted the mcarroll/json-schema-fix-assertion branch July 30, 2020 17:09
yavorona pushed a commit that referenced this pull request Aug 1, 2020
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