-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix: prevent setRawValue to convert 0 to empty string #116
fix: prevent setRawValue to convert 0 to empty string #116
Conversation
Would it be worth adding a test for this? |
@ryanggrey I just added a single unit test for this use case. |
value = helpers.rawToFormatted(val, this.options); | ||
} else if (typeof val === 'string') { | ||
value = val; | ||
} else if (!val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this else-if clause if the clause above will fire instead? (empty string is typeof string, setting value to '')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is my understanding setRawValue
is a public method, and can be called with undefined
or null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me
Closes #113