Open LordZardeck opened 1 year ago
I would start a PR that adds a failing test for this, but I this repository doesn't have type testing. That might be useful.
Quick question, is there a reason not to just use type-fest
's CamelCasedPropertiesDeep
? seems redundant to have the same type. This library could just be the function to camelcase the properties at runtime. Since type-fest
is a type-only library, it shouldn't have any extra build bloat.
I'd rather not add any dependencies to this project if we can avoid it. But we can certainly steal the implementation from type-fest if it works better (with proper attribution ofc).
I'm here with a model having a nullable item, asking to cover that case :D
I'm not a ts wizard so maybe I'm wrong, but I see that it works by adding | null
next to {} | undefined
here. Does it break anything else?
If you have a child prop that has a null union,
Camelize
stops trying to camelize that property. The following is a basic reproducable example:You'll notice that TypeScript complains that
child.fooBar
is not a valid property, butchild.foo_bar
is.