Skip to content

Align behavior of [Camel|Pascal|Kebab|Snake]-Cased types with lodash#1394

Merged
sindresorhus merged 27 commits intosindresorhus:mainfrom
jericirenej:fix/1229-x-cased-properties-align-behavior-with-lodash
Mar 29, 2026
Merged

Align behavior of [Camel|Pascal|Kebab|Snake]-Cased types with lodash#1394
sindresorhus merged 27 commits intosindresorhus:mainfrom
jericirenej:fix/1229-x-cased-properties-align-behavior-with-lodash

Conversation

@jericirenej
Copy link
Copy Markdown
Contributor

  • WordsOptions: splitOnPunctuation option added. Defaults to false for now, so no breaking changes are introduced. Updated JSDoc for the Words type.
  • CamelCase, PascalCase, KebabCase, SnakeCase:
    • added tests for the new punctuation option.
    • Updated JSDocs to indicate how the new splitOnPunctuation option can be used.
    • CamelCase uses _DefaultWordsOptions instead of specifying defaults directly (this would require updates every time a new default option would be added).
  • Updated JSDocs follow the type NamedType1 = NamedType<Value>; //=> result pattern.

Closes #1229

@jericirenej jericirenej changed the title Fix/1229 Align behavior of X-Cased type helpers with lodash Fix/1229 Align behavior of [Camel|Pascal|Kebab|Snake]-Cased types with lodash Mar 29, 2026
@jericirenej jericirenej changed the title Fix/1229 Align behavior of [Camel|Pascal|Kebab|Snake]-Cased types with lodash Align behavior of [Camel|Pascal|Kebab|Snake]-Cased types with lodash Mar 29, 2026
Copy link
Copy Markdown
Collaborator

@som-sm som-sm left a comment

Choose a reason for hiding this comment

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

Please don't change the way docs and tests are written as part of this PR. Keep this PR focused on splitOnPunctuation changes. If you want to streamline the docs and tests, consider opening a separate PR for that.

@som-sm
Copy link
Copy Markdown
Collaborator

som-sm commented Mar 29, 2026

Also, please add tests for *CasedProperties and *CasedPropertiesDeep.

@jericirenej
Copy link
Copy Markdown
Contributor Author

Please don't change the way docs and tests are written as part of this PR. Keep this PR focused on splitOnPunctuation changes. If you want to streamline the docs and tests, consider opening a separate PR for that.

Ok, I'll change it so that it's in the similar pattern as the originals. The changes were very minor and aimed to increase readability of the JSDoc. I understand that here they are seen as problematic, because they are outside the ticket scope

@som-sm
Copy link
Copy Markdown
Collaborator

som-sm commented Mar 29, 2026

The changes were very minor and aimed to increase readability of the JSDoc.

Yeah, the changes themselves were fine, just not in the scope of this PR.

@jericirenej jericirenej force-pushed the fix/1229-x-cased-properties-align-behavior-with-lodash branch from a5b6b43 to 668146f Compare March 29, 2026 15:28
@jericirenej
Copy link
Copy Markdown
Contributor Author

jericirenej commented Mar 29, 2026

Also, please add tests for *CasedProperties and *CasedPropertiesDeep.

Added.

I also updated the JSDocs for the x-cased-properties and x-cased-properties-deep types

Copy link
Copy Markdown
Collaborator

@som-sm som-sm left a comment

Choose a reason for hiding this comment

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

PR LGTM, just a few minor comments. Nice work, thanks for picking this up!

@sindresorhus sindresorhus merged commit 852d016 into sindresorhus:main Mar 29, 2026
6 checks passed
@jericirenej jericirenej deleted the fix/1229-x-cased-properties-align-behavior-with-lodash branch March 30, 2026 15:26
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.

KebabCasedProperties: Align behavior with Lodash

3 participants