-
Notifications
You must be signed in to change notification settings - Fork 11
fix: remove redundant string formatter methods #703
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
Codecov Report
@@ Coverage Diff @@
## main #703 +/- ##
==========================================
- Coverage 85.16% 85.15% -0.01%
==========================================
Files 782 782
Lines 16042 16036 -6
Branches 2048 2046 -2
==========================================
- Hits 13662 13656 -6
Misses 2347 2347
Partials 33 33
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
.join(' '); | ||
export const titleCaseFromKebabCase = (kebabCaseString: string): string => titleCaseFromString(kebabCaseString, '-'); | ||
|
||
export const titleCaseFromWhiteSpacedString = (whiteSpacedString: string): string => |
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.
Is this method similar to Lodash's 'startCase' ?
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.
Yep
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 still need this new method? 🙂
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.
startCase works for the other cases for which we've defined util methods as well (kebab/snake case to title case). Going by that, my understanding was that if its light enough, we'll define our own?
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.
Going by that, my understanding was that if its light enough, we'll define our own?
I think that goes more for components (as the styling on these evolves) or for util function that we'd need to bring in a new dependency for (such as the whole iso duration thing). If we had no lodash dependency, we shouldn't bring it in for this - but since we do have it and it's already in widespread use, we should be ok to use it where it does exactly what we want.
They might have been written without knowing about start case - or maybe they behave a little differently? If the behavior is identical, then we need not implement it ourselves - although we likely leave the existing ones here for backwards compatibility (could deprecate them, though)
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.
I would vote for deprecating them if they are exactly the same.
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.
I'd also prefer deprecating them then. startCase works for whitespaced, kebab case and snake cased strings.
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.
Deprecated.
Description
Remove redundant string formatter methods. Usages to be replaced with startCase in lodash.
Testing
N/A
Checklist: