feat: add range error validation for datatypes#1594
Merged
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1594 +/- ##
===========================================
- Coverage 78.24% 66.05% -12.19%
===========================================
Files 93 93
Lines 4821 4858 +37
Branches 921 932 +11
===========================================
- Hits 3772 3209 -563
- Misses 750 1245 +495
- Partials 299 404 +105 ☔ View full report in Codecov by Sentry. |
| } | ||
|
|
||
| if (value < MIN_DATE || value > MAX_DATE) { | ||
| throw new TypeError('Out of range.'); |
Collaborator
There was a problem hiding this comment.
Should this be RangeError instead? 🤔
arthurschreiber
approved these changes
Jan 31, 2024
| import { ChronoUnit, LocalDate } from '@js-joda/core'; | ||
| import { type InternalConnectionOptions } from '../connection'; | ||
|
|
||
| import { Collation } from '../collation'; |
Collaborator
There was a problem hiding this comment.
Does this work? 🤔
Suggested change
| import { Collation } from '../collation'; | |
| import { type Collation } from '../collation'; |
…usjs/tedious into michael-DatatypeRangeCheck
Contributor
|
🎉 This PR is included in version 16.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
KAMAELUA
pushed a commit
to KAMAELUA/tedious-decimal
that referenced
this pull request
Apr 29, 2024
* chore: add range error validation for date types * add validation tests for numbers * remove only * add money validation * chore: remove un-needed types --------- Co-authored-by: mShan0 <96149598+mShan0@users.noreply.github.com> (cherry picked from commit 19cb073)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add range error check for datatypes:
Adds validate tests for datatypes:
Referenced the changes from this PR: #1271 : fix: out-of-range date error handle
Referenced the changes from PR #815 for money validation