Skip to content

Conversation

edcheung1
Copy link

@edcheung1 edcheung1 commented Jun 13, 2025

Description

Add two new options:

  • excludeChildren
    • Takes in ReadonlyArray<string | RegExp>. When a key's parent matches one of the entries in excludeChildren[], the key will not be camelcased
  • overrides
    • Takes in ReadonlyArray<[string | RegExp, string]>. When a key matches the first entry in an overrides[] tuple, the key will be manually converted to the second entry in the tuple

Testing

yarn test

Companion PR: sindresorhus/decamelize-keys#11

@sindresorhus
Copy link
Owner

Thanks for the pull request. However, I think there are too many options related to exclusion now. Try to think of a way to simplify it.

*
* //=> {'foo_baz': true, nested: {'unicorn_rainbow': true}}
*/
readonly overrides?: ReadonlyArray<[string | RegExp, string]>;
Copy link
Owner

Choose a reason for hiding this comment

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

This is not really related to camel-casing.

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.

2 participants