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

Decamelize function #6615

Merged
merged 2 commits into from
Oct 3, 2022
Merged

Decamelize function #6615

merged 2 commits into from
Oct 3, 2022

Conversation

lonnieezell
Copy link
Member

New inflector helper function, decamelize.

Converts strings form camelCase or PascalCase into snake_case.

echo decamelize('MyDogSpot');    // echoes my_dog_spot

@lonnieezell lonnieezell changed the base branch from develop to 4.3 October 1, 2022 03:54
@kenjis kenjis added 4.3 enhancement PRs that improve existing functionalities labels Oct 1, 2022
Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

Nice addition! Makes me wonder what you are working on 🤔

Please add tests for smaller strings: a, A, Ab, aB, AB, ab.

@lonnieezell
Copy link
Member Author

Additional test cases added.

@lonnieezell lonnieezell merged commit 514e535 into 4.3 Oct 3, 2022
@lonnieezell lonnieezell deleted the decamelize branch October 3, 2022 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.3 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants