/** * Returns a recursive union the values for a given type. * * e.g. * ```ts * const x = { * a: { * b: { * c: 'foo' * }, * d: 'bar' * } * e: 'baz' * } * * DeepUnion // 'foo' | 'bar' | 'baz' * ``` */ export type DeepUnion> = T extends object ? { [K in keyof T]: DeepUnion; }[keyof T] : T;