Closed gabejohnson closed 5 years ago
The problem occurs a few lines down with partialCombinator
https://github.com/gcanti/io-ts-codegen/blob/30f6374b08ab0fc2928f6b66185f266d84132258/src/index.ts#L612-L614
It may be worth passing name
to t.readonly
as well.
@gabejohnson good catch, thanks for the bug report!
It may be worth passing
name
tot.readonly
as well
Maybe, I'm not sure about that. IMO I should drop the isReadonly
boolean and add an explicit ReadonlyCombinator
I should drop the
isReadonly
boolean and add an explicitReadonlyCombinator
@gabejohnson in the meanwhile which name should I use for t.readonly
in your opinion? declaration.name
?
which name should I use for
t.readonly
in your opinion?declaration.name
?
That was my thinking
@gabejohnson released a patch, let me know if it works for you
Thanks for addressing this so quickly!
Maybe, I'm not sure about that. IMO I should drop the
isReadonly
boolean and add an explicitReadonlyCombinator
I agree
While attempting to give custom names to my types, I noticed that some of my codices receive the name, while others do not. It turns out that those with optional properties are the ones that don't.
I believe I've tracked this down to https://github.com/gcanti/io-ts-codegen/blob/30f6374b08ab0fc2928f6b66185f266d84132258/src/index.ts#L600-L610
Notice that
ic.name
is not being passed downintersectionCombinator
.I can submit a PR if you'd like.