#Recursive transform issue
5 messages · Page 1 of 1 (latest)
Preview:```ts
// project schema
type A = { a: string }
type B = { b: boolean }
type C = { c: number }
type D = { d: string[] }
type E = { e: boolean[] }
type Union = A | B | C | D | E
type Foo = {
not: string
union: Union
narrow: A
}
type Bar = {
nested: {
inner: B
...```
ughhh my brain 🤯 this is a tough one. i need to do recursion but enable distributivity in some situations and disbale in others...
Preview:```ts
// project schema
type A = { a: string }
type B = { b: boolean }
type C = { c: number }
type D = { d: string[] }
type E = { e: boolean[] }
type F = { f: number[] }
type Union = A | B | C | D | E | F
type Foo = {
not: string
union: Union
narrow1: A
...```
ok managed to solve it by splitting into 2 generics - 1 has distributivity enabled and the other doesn't, and i recurse between them
the only thing is the output has an undefined and im not sure where it's coming from