-
Notifications
You must be signed in to change notification settings - Fork 130
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
Camel Case Support #127
Comments
What's the use case for this? If you only need to worry about const slugify = require('slugify')
const options = { lower: true }
function getSlug(str) {
return slugify(str.replace(/[A-Z]/g, '-$&'), options)
}
console.log(getSlug('FooBarBaz')) // 'foo-bar-baz'
console.log(getSlug('Foo BarBaz')) // also 'foo-bar-baz' |
I'm doing something similar, my question was to know if the lib already has a solution for it and/or if it's a good feature to have.
Twitter |
There's not anything like a simple option to set at this time.
Perhaps, but I'd personally be cautious about adding such a feature because:
Of course, it's possible I'm missing things, like additional use cases that might argue strongly in favor of a feature like this. |
Sure thing Trott, certainly is something that should be more investigate. But my proposal isn't that the library use this as default, but as a config that we can enable/disable when/if needed. In cases like your example About the languages that don't use A-Z alphabet can really be very tricky. I don't know its rules. They could be ignored initially, until the contributors decide when/how the feature should be applied. Anyway, I'm fine to use a separate code do handle these cases, but would be great to have this here as an option. |
Is there a way to convert
FooBarBaz
tofoo-bar-baz
?Would be great if we've this option.
Note that
Foo BarBaz
should generatefoo-bar-baz
instead offoo--bar-baz
.The text was updated successfully, but these errors were encountered: