You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @pabra! Thanks so much for this great library. My company is using to great effect. The struggle we ran into is that if you have a nested object with colliding keys, the generated types aren't named very well. e.g.:
We thought it would be more powerful to look up the object chain to the parent for collisions so it would generate:
typeNames=["john","judy"];typeAnimalNames=["beau","max"];//open question here about how to combine the names, we use _, but others might use different characters
or maybe even
typePeopleNames=["john","judy"];typeAnimalNames=["beau","max"];//open question here about how to combine the names, we use _, but others might use different characters
I have a POC in a patch locally for something like the first option. We were wondering if collision resolution was something you'd want to bake into the project differently, maybe as an option in args? Otherwise something like this would likely be a breaking change
The text was updated successfully, but these errors were encountered:
I think, I would prefer it so much to make that the new default.
Honestly, I haven't touched this repo in years and am not sure when to find time, to look into your suggestion. Do you mind creating an PR or sharing patch/branch?
PS: I am glad, this tiny project is useful to you.
More than happy to share the patch I made. It currently works like the first example, i.e. the first key takes the short name and subsequent ones get the prefix. I'll put up what I have for now even though it's a little messy. I can look into solving the name collisions symmetrically so both collision members would get hierarchical paths as well as fix combining characters as a follow up
Hey @pabra! Thanks so much for this great library. My company is using to great effect. The struggle we ran into is that if you have a nested object with colliding keys, the generated types aren't named very well. e.g.:
would generate something like:
We thought it would be more powerful to look up the object chain to the parent for collisions so it would generate:
or maybe even
I have a POC in a patch locally for something like the first option. We were wondering if collision resolution was something you'd want to bake into the project differently, maybe as an option in args? Otherwise something like this would likely be a breaking change
The text was updated successfully, but these errors were encountered: