aninest root / RecursiveHelpers / Recursive
Recursive<Base, Shape>
ts
type Recursive<Base, Shape>: { [P in keyof Shape]: Shape[P] extends Base ? Base : Recursive<Base, Shape[P]> };
Generic type which allows for the recursive definition of an object which either has a value of type Base
or a subtree of the same type.
Type Parameters
• Base
• Shape