type VeryComplexType = ... // (discriminated union of 40 options that comes from some library)
// error: Type instantiation is excessively deep and possibly infinitely deep
const FooPayload = type({
bar: 'object' as type.cast<VeryComplexType>
})
const router = {
get(): procedure().output(FooPayload).query(() => {...})
}
type VeryComplexType = ... // (discriminated union of 40 options that comes from some library)
// error: Type instantiation is excessively deep and possibly infinitely deep
const FooPayload = type({
bar: 'object' as type.cast<VeryComplexType>
})
const router = {
get(): procedure().output(FooPayload).query(() => {...})
}