Open mikesol opened 5 years ago
Calling t.brandCombinator on a recursive feild results in something like this:
t.brandCombinator
const Schema: t.RecursiveType<t.Type<Schema>> = t.recursion('Schema', () => t.brand(_Schema, (x): x is t.Branded<_Schema, XPropertiesBrand> => true, 'XProperties') interface XPropertiesBrand { readonly XProperties: unique symbol })
The interface is placed within the recurisve expression.
That happens because of this line: https://github.com/gcanti/io-ts-codegen/blob/0be18841a50ceb0a45ade7f4bf0d9b365e33018c/src/index.ts#L788
One idea for a fix: another function instead of printRuntime (ie printDefinitions) could be used to print this sort of thing.
printRuntime
printDefinitions
Calling t.brandCombinator on a recursive feild
@mikesol could you please post a small repro?
Calling
t.brandCombinator
on a recursive feild results in something like this:The interface is placed within the recurisve expression.
That happens because of this line: https://github.com/gcanti/io-ts-codegen/blob/0be18841a50ceb0a45ade7f4bf0d9b365e33018c/src/index.ts#L788
One idea for a fix: another function instead of
printRuntime
(ieprintDefinitions
) could be used to print this sort of thing.