Type alias CollectResults<T, Collected, Depth>

CollectResults<T, Collected extends unknown[], Depth extends number>: [Depth] extends [never]
    ? []
    : T extends [infer H, ...(infer Rest)]
        ? H extends neverthrow.Result<infer L, infer R>
            ? CollectResults<Rest, [...Collected, [L, R]], Prev[Depth]>
            : never
        : Collected

Type Parameters

  • T
  • Collected extends unknown[] = []
  • Depth extends number = 50