(self: Chunk<Option<A>>)
| 1102 | * @since 2.0.0 |
| 1103 | */ |
| 1104 | export const compact = <A>(self: Chunk<Option<A>>): Chunk<A> => { |
| 1105 | const out: Array<A> = [] |
| 1106 | for (const option of self) { |
| 1107 | if (O.isSome(option)) { |
| 1108 | out.push(option.value) |
| 1109 | } |
| 1110 | } |
| 1111 | return fromArrayUnsafe(out) |
| 1112 | } |
| 1113 | |
| 1114 | /** |
| 1115 | * Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements. |
nothing calls this directly
no test coverage detected