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

Provides ability to configure custom acronyms #28

Merged
merged 1 commit into from
Nov 22, 2020

Conversation

tyronewilson
Copy link
Contributor

I was using strcase to normalise some JSON keys and found that I had an acronym which wasn't being handled nicely. The acronym was "COGS" and it was being used to convert to either Cogs or cOGS. I wanted cogs.

With this PR I can now do

strcase.ConfigureAcronym("COGS", "cogs") 

this now means that using ToLowerCamel("COGS") will give me what I need.

I think this is a useful feature in general as I found that the acronyms were currently limited to "ID": "id" with no way to configure additional ones.

Let me know if you would like to include this :)

@tyronewilson
Copy link
Contributor Author

Just following up here. Are we able to merge this?

@iancoleman iancoleman merged commit 77cf97e into iancoleman:master Nov 22, 2020
@iancoleman
Copy link
Owner

Thanks for this and sorry for the delay! Much appreciated and seems like a handy feature.

@tyronewilson
Copy link
Contributor Author

tyronewilson commented Nov 23, 2020 via email

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