feat(fmt/case): Add casing helpers
This PR implements a few casing helpers, as were asked in the issue #3125 It adds a few helpers methods such as:
- toPascalCase
- toCamelCase
- toSnakeCase
- toScreamingSnakeCase
- toKebabCase
- toTitleCase
Any suggestions on more methods would be appreciated, I've just implemented the ones I could find any use for
Title case maybe?
I think it would make more sense to have an implementation that doesn't just split by whitespaces but also other separators and by words so a case can be applied to another like in lodash. Example:
toKebabCase('Foo Bar') // => 'foo-bar'
toKebabCase('fooBar') // => 'foo-bar'
toKebabCase('__FOO_BAR__') // => 'foo-bar'
@timreichen true, it would make a lot more sense, I'll take a look at their implementation then :)
toSentenceCase
Closing this in favour of #4082, which continues the work started here. Thank you for your contribution, @Gustrb!