(
combiners: { readonly [K in keyof A]: Combiner.Combiner<A[K]> }
)
| 670 | * @since 4.0.0 |
| 671 | */ |
| 672 | export function makeCombiner<A extends ReadonlyArray<unknown>>( |
| 673 | combiners: { readonly [K in keyof A]: Combiner.Combiner<A[K]> } |
| 674 | ): Combiner.Combiner<A> { |
| 675 | return Combiner.make((self, that) => { |
| 676 | const out = [] |
| 677 | for (let i = 0; i < self.length; i++) { |
| 678 | out.push(combiners[i].combine(self[i], that[i])) |
| 679 | } |
| 680 | return out as any |
| 681 | }) |
| 682 | } |
| 683 | |
| 684 | /** |
| 685 | * Creates a `Reducer` for a tuple shape by providing a `Reducer` for each |
no test coverage detected