Open TristanSpeakEasy opened 1 year ago
This is interesting and something worth considering. Trying to think through some of the performance and API implications before I rush something out. Thanks for the suggestion.
You can try #13 by doing go get github.com/ettle/strcase@liyanchang-preserve-initialism
and let me know how that goes!
You will need to use a custom caser.
Hi, great library btw it has been very helpful with code gen work we are doing!
What did you do?
strcase.ToCamel("nativeOrgURL")
What did you expect to see?
output == "nativeOrgURL"
What did you see instead?
output == "nativeOrgUrl"
I was looking through the options of creating a custom caser and thought omitting the
SplitAcronym
option may have produced the output I would have expected.But basically I would like to be able to pass a string and be able to retain any acronyms that are contained within without needing to understand the input and try and populate the initialisms map with any acronyms I want to retain (as the input comes from end-users so we could receive any acronym), I can't really use
strcase.ToGoCamel
as it initializes acronyms that weren't initially upper case ienativeOrgUrl
as we are generating code for languages other than Go.Basically if
input = "nativeOrgURL"
thenoutput = "nativeOrgURL"
input = "nativeOrgUrl"
thenoutput = "nativeOrgUrl"
I don't see a way to achieve this at the moment with the library, any help figuring out if this is possible would be appreciated.
while it looks like I am just trying to have a noop in the case of the examples above we could receive inputs that are of any case for example
native_org_url
orNativeOrgURL
and want to format tonativeOrgUrl
ornativeOrlURL
to produce properties names suitable for a typescript class for example