-
Notifications
You must be signed in to change notification settings - Fork 593
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
chore(clients): parse numbers more strictly #2662
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2662 +/- ##
=======================================
Coverage ? 60.73%
=======================================
Files ? 521
Lines ? 27833
Branches ? 6847
=======================================
Hits ? 16904
Misses ? 10929
Partials ? 0 Continue to review full report at Codecov.
|
33ad392
to
1f5dc34
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This provides methods to more strictly parse floats and ints. The strict float parser only allows explicit NaN and does not attempt to parse non-string, non-number values. The strict int parser disallows NaN entirely, and will opt to error if there are any decimals present. It also will noot parse non-string, non-number values.
1f5dc34
to
57e6cbe
Compare
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
n/a
Description
This provides methods to more strictly parse floats and ints. The strict float parser only allows explicit NaN and does not attempt to parse non-string, non-number values. The strict int parser disallows NaN entirely, and will opt to error if there are any decimals present. It also will not parse non-string, non-number values.
Testing
Unit tests were added for new methods. This also fixes a number of generated tests not released yet in Smithy.
Additional context
JS is very loose about what it will convert to a number, and we don't want to be nearly so loose, especially in the SSDK.
Related: smithy-lang/smithy-typescript#397
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.