-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
feat(helpers): allow empty string in fake #1679
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #1679 +/- ##
==========================================
- Coverage 99.64% 99.64% -0.01%
==========================================
Files 2240 2240
Lines 240106 240098 -8
Branches 1072 1068 -4
==========================================
- Hits 239247 239239 -8
Misses 838 838
Partials 21 21
|
ca62689
d0635eb
to
ca62689
Compare
Is this a breaking change? I (as a user) could have the following case: function foo(unvalidatedInput: string) {
try {
return fake(unvalidatedInput);
} catch {
// I use the fact, that faker.helpers.fake() can't handle empty strings
return myDefaultValue;
}
} Just want to get the labels correct and PR title. |
5c44abc
If you are relying on the fact that the method throws on empty strings, then yes it is a breaking change. But:
aka it was explicitly undefined behavior before I'm fine with marking this as breaking or not. |
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.
We explicitly told the user not to use empty strings
That's a good point. Then it's not breaking IMO.
Fixes #1457
Allows
faker.helpers.fake('')
=>''