( self: Option<A>, collection: Iterable<Option<A>> )
| 1325 | * @since 2.0.0 |
| 1326 | */ |
| 1327 | export const productMany = <A>( |
| 1328 | self: Option<A>, |
| 1329 | collection: Iterable<Option<A>> |
| 1330 | ): Option<[A, ...Array<A>]> => { |
| 1331 | if (isNone(self)) { |
| 1332 | return none() |
| 1333 | } |
| 1334 | const out: [A, ...Array<A>] = [self.value] |
| 1335 | for (const o of collection) { |
| 1336 | if (isNone(o)) { |
| 1337 | return none() |
| 1338 | } |
| 1339 | out.push(o.value) |
| 1340 | } |
| 1341 | return some(out) |
| 1342 | } |
| 1343 | |
| 1344 | /** |
| 1345 | * Combines a structure of `Option`s into a single `Option` containing the |
no test coverage detected