map

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

Platform and version requirements: JVM

Returns a channel containing the 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.