( self: Option<A>, collection: Iterable<Option<A>> )
| 1564 | * @since 2.0.0 |
| 1565 | */ |
| 1566 | export const productMany = <A>( |
| 1567 | self: Option<A>, |
| 1568 | collection: Iterable<Option<A>> |
| 1569 | ): Option<[A, ...Array<A>]> => { |
| 1570 | if (isNone(self)) { |
| 1571 | return none() |
| 1572 | } |
| 1573 | const out: [A, ...Array<A>] = [self.value] |
| 1574 | for (const o of collection) { |
| 1575 | if (isNone(o)) { |
| 1576 | return none() |
| 1577 | } |
| 1578 | out.push(o.value) |
| 1579 | } |
| 1580 | return some(out) |
| 1581 | } |
| 1582 | |
| 1583 | /** |
| 1584 | * Combines a structure of `Option`s (tuple, struct, or iterable) into a single |
no test coverage detected