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

Expose preserveConsecutiveUppercase option #115

Merged
merged 5 commits into from Sep 29, 2023

Conversation

simonradier
Copy link
Contributor

@simonradier simonradier commented Sep 26, 2023

Hi @sindresorhus,

Thanks for your great work. It is very useful in my current project.

Based on #88 request, I added the preserveConsecutiveUppercase option.
I updated the following elements :

  • index.js to support the preserveConsecutiveUppercase option
  • index.d.ts with to reflect the preserveConsecutiveUppercase option for types
  • index.d.ts with new tests related to the option and typing
  • test.ts with new tests to validate the option works accordingly
  • README.md to reflect the add of the preserveConsecutiveUppercase option

I proposed a bump to the version 10.0.0 based on your versioning strategy.


Fixes #88

@@ -27,6 +27,9 @@ camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true});
camelcaseKeys({a_b: 1, a_c: {c_d: 1, c_e: {e_f: 1}}}, {deep: true, stopPaths: ['a_c.c_e']}),
//=> {aB: 1, aC: {cD: 1, cE: {e_f: 1}}}

camelcaseKeys({'foo-BAR': true, nested: {unicorn_RAINbow: true}}, {deep: true, preserveConsecutiveUppercase: true});
//=> {fooBAR: true, nested: {unicornRAINbow: true}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be on line 125, together with the docs for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the way it was made for the other options. At the moment it is not the case for all the option. It is also consistent with your other related packages (i.e. camelcase README).
=> Is it ok to keep it like this at the moment? I've added an example with the value = false as well.
If yes, I'll you resolve it :)

readme.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 507d5d0 into sindresorhus:main Sep 29, 2023
3 checks passed
@sindresorhus
Copy link
Owner

Thanks :)

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

Successfully merging this pull request may close these issues.

Expose the preserveConsecutiveUppercase option
2 participants