mapNotNull

fun <E, R : Any> ReceiveChannel<E>.mapNotNull(
    context: CoroutineContext = Unconfined,
    transform: suspend (E) -> R?
): ReceiveChannel<R>
(source)

Platform and version requirements: JVM

Returns a channel containing only the non-null results of applying the given transform function to each element in the original channel.

The operation is intermediate and stateless. This function consumes all elements of the original ReceiveChannel.