Closed PauloFerreira25 closed 5 months ago
It's a good idea, but unfortunately it's not something I want to maintain in the library at this point in time. I want the flexibility to potentially refactor the code to not be a regex in the future, or to be able to refactor the regex if I have a chance to review performance. This change would tie me to the current very specific behavior. I'd honestly suggest just writing the specific split
you want, since you probably don't need some of the features. A very simple split
would just be:
const split = (value) => value.replace(/[^\p{L}\d\:]+/g, ' ').trim().split(' ');
Hello, I completely understand your opinion. This was the reason I opened a PR and asked if it would be useful.
Thank you very much for your attention.
Hello,
Please rate my idea.
My problem: I'm using kebabCase, but I need to ignore the ':' character, preventing it from being replaced.
I understand that to do this, the idea would be for me to pass a split function into Options.
However, I only need to make 1 small modification to the regex, including the ':' in DEFAULT_STRIP_REGEXP.
What I thought, if everything turns into export, I could simply import the split function, modify the options that is passed through it, and use this new function in the options parameter of kebabCase.
I understand that you can simply copy the code and place it inside my system, pointing to the split, and be happy. But I believe that allowing reuse would be better.
I believe that the PR needs to undergo changes. I only did the minimum to present the idea.
If what I proposed is not part of what the repository is proposing. Please excuse me.
Thank you for your attention.