Compared to lodash, ramda doesn't have kebabCase functionality.
Wondering why it hasn't implemented yet.
(Just for curiosity. If rambda Project's directional doesn't match with adding bunch of String manipulate functions, It's totally fine. Respect that.)
@DanielTimLee Hi, see https://ramda-extension.firebaseapp.com/docs/#toKebabCase.
Hi @DanielTimLee, thanks for the issue. I think ramda-extension is a better place for this function. It's a little too specific and high level to be introduced into Ramda, but we can leave this open to see what sort of interest it garners.
Compared to
lodash,ramdadoesn't havekebabCasefunctionality.Wondering why it hasn't implemented yet.
We don't look to lodash, or Underscore, or really any other JS libraries for inspiration. Our goals are different, our basic philosophy is different, and our focus is different. So the fact that a function is in lodash makes no difference as to whether we'll include it.
While we do take inspiration from ML-style and LISP-style languages as well as Erlang, we're also not trying to port their APIs either.
I agree with @Bradcomp: this makes more sense in ramda-extension, ramda-adjunct, and/or the Cookbook. And of course there's a million implementations available on the web if you need one. Or here's an untested million-and-first:
const kebabCase = s => s.replace(/([A-Z])/g, ' $1')
.replace(/(\W+)/g, '-')
.replace(/^-|-$/g, '')
.toLowerCase()
Most helpful comment
@DanielTimLee Hi, see https://ramda-extension.firebaseapp.com/docs/#toKebabCase.