-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
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(utils): unify common utility scripts #18059
fix(utils): unify common utility scripts #18059
Conversation
@raisedadead @Bouncey Why is the PR still open if labeled blocked? |
Opps... wrong button |
Hi @ojeytonwilliams @paulywill this is change that we are evaluating for inclusion. We have merged the learn platform in this main repo. So, it needs to be decided where we need to put up some common utils like such as this file. We haven't gotten around to this, hence the blocked status. The action is on the @freeCodeCamp/dev-team for now. Thanks. |
@raisedadead What are we thinking about this Pr a.t.m? |
@ValeraS Is this PR still needed, since you made the recent changes to dasherize? The only other thing I see is changes to |
@RandellDawson I think an updated version of this PR is needed, since there are still several instances of Nonetheless, if they can be unified, presumably they should be. Perhaps in a new common utils directory. |
c4bf454
to
f03147f
Compare
Are we able to revisit or close this @ojeytonwilliams ? |
Well, this is stale to the point of useless, but I still think we should DRY out this stuff. I've taken another look at the three dasherize functions and they all have exactly the same functionality. They're just written slightly differently. Is there any reason not to just put a single util in the root dir and have the client, server and curriculum all use that? |
There is none. Please go ahead with the refactor if you are interested. |
9bda6c8
to
e12def6
Compare
e12def6
to
1ba016f
Compare
Hi @ojeytonwilliams I like this, and going forth we should probably using this structure for our utils. Do you mind throwing some unit tests in? Once you do please, feel free to hit the merge button. |
@raisedadead are these tests what you had in mind? They made me realise that " a title " becomes "-a-title--", which doesn't look great. Perhaps we should trim the strings first. |
These tests are perfect and as you seem to have found a use case where we do need to trim the spaces. |
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.
LGTM
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.
You sir rock!
Unify common scripts like dasherize.