All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dev.inmo.tgbotapi.utils.Map.kt Maven / Gradle / Ivy

Go to download

Core part of tgbotapi with all (and only) required functionality for working with Telegram Bot API

There is a newer version: 24.0.1
Show newest version
package dev.inmo.tgbotapi.utils

fun  mapOfNotNull(vararg pairs: Pair): Map {
    return HashMap().apply {
        pairs.forEach {
            (key, value) ->
            value ?.also {
                put(key, it)
            }
        }
    }
}

fun  Map.mapNotNullValues(): Map = asSequence().mapNotNull {
    it.value ?.let { value ->
        it.key to value
    }
}.toMap()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy