Skip to content
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

Sentence case #25

Open
souporserious opened this issue Apr 27, 2022 · 3 comments
Open

Sentence case #25

souporserious opened this issue Apr 27, 2022 · 3 comments

Comments

@souporserious
Copy link

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 😊

@cedeber
Copy link

cedeber commented Feb 17, 2023

Same for titleCase, then 😊

@mesqueeb
Copy link
Owner

@souporserious @cedeber PRs welcome!

@tommy-mitchell
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants