Open souporserious opened 2 years ago
Same for titleCase, then 😊
@souporserious @cedeber PRs welcome!
The title-case
package has a sentenceCase
option (vs. a naive sentence case):
titleCase("hello there, world! I'm Tommy.", { sentenceCase: true })
//=> "Hello there, world! I'm Tommy."
naiveSentenceCase("hello there, world! I'm Tommy.")
//=> "Hello there, world! i'm tommy."
Should both be supported, or should sentenceCase
be a wrapper around titleCase
? i.e:
function sentenceCase(string, options) {
return titleCase(string, { ...options, sentenceCase: true })
}
Perhaps a simple
option could be added as well, for the naive output.
Hello, thank you for this wonderful utility library! I was curious if you'd be willing to add a
sentenceCase
utility? I saw it was briefly considered in #10. I think this would be great for design systems that want to enforce this in UI elements like buttons. Happy to submit a PR if it sounds good 😊