-
Notifications
You must be signed in to change notification settings - Fork 165
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: getKebabCase #294 #313
Conversation
convert the whitespace and underscore to minus sign without replace it with camel case.
✔️ Deploy Preview for wargabantuwarga ready! 🔨 Explore the source changes: 138c2ff 🔍 Inspect the deploy log: https://app.netlify.com/sites/wargabantuwarga/deploys/60fcbb571730c80008c6372e 😎 Browse the preview: https://deploy-preview-313--wargabantuwarga.netlify.app |
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.
For the test case mentioned in #294 it's okay
But there are some cases that still not covered, for example:
Text containing special character
"PUTRA SOERADI" Jual Peti Mati: -putra-soeradi-jual-peti-mati
Hoo Hap Hwee (Perkumpulan Budi Abadi): hoo-hap-hwee-perkumpulan-budi-abadi-
Please trim trailing -
Also for text containing .
, what is the rule?
Could you confirm the rule and include it on test case? @zainfathoni
For example, with updated function, it'll be:
D.I. Yogyakarta: d.i.-yogyakarta
UD. Bpk. Giyanto Sedia/Jual Peti Jenazah: ud.-bpk.-giyanto-sedia-jual-peti-jenazah
Ambulancesiaga.com: ambulancesiaga.com
Samator, PT. Aneka Gas Industri, Tbk.: samator-pt.-aneka-gas-industri-tbk.
I think the .
should be removed, or replaced with -
Please add all the edge cases for into the issue description, Mbak @ekamuktia. We can discuss all the possibilities there. You should have had access to edit the issue description because I have invited you as a maintainer of this repository. If you aren't able to do it, please check your email to accept the invitation, thanks! |
Test cases updated in #294 description |
just done it with the new test cases, will start commiting ASAP |
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.
Please fix parts that causing eslint error by adding new line as suggested on the error message
https://github.com/kawalcovid19/wargabantuwarga.com/pull/313/checks?check_run_id=3140847528
try to fix eslint , 1st attempt
try to fix eslint error, attempt 2
That expected value was for the old implementation, we need to put those wrong values so that the test doesn't break the |
already update the unit test based on current implementation |
Codecov Report
@@ Coverage Diff @@
## main #313 +/- ##
==========================================
+ Coverage 13.15% 13.60% +0.45%
==========================================
Files 70 67 -3
Lines 859 823 -36
Branches 229 228 -1
==========================================
- Hits 113 112 -1
+ Misses 742 707 -35
Partials 4 4
Continue to review full report at Codecov.
|
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 💯
Based on the exhaustive test on getKebabCase
, now we're pretty confident that the function works as expected. Thanks a lot, @fncolon! 🙏
The requested changes have been implemented.
Fixes #294 #110
Description
Convert the whitespace and underscore to minus sign without replace the spaces with camel case to fix the issue.
Current Tasks