mapValuesNotNull

inline fun <K, V, R : Any> Map<K, V>.mapValuesNotNull(transform: (Map.Entry<K, V>) -> R?): Map<K, R>

Returns a map with each value replaced by the result of transform, dropping entries where it returns null.

Keys are unchanged and entry order is preserved.