```mapOf( { conditionA to (3 to 4) }, { co...
# getting-started
k
Copy code
mapOf(
    { conditionA to (3 to 4) },
    { conditionB to (3 to 5) }
)

inline fun <K, V> mapOf(vararg addFunctions: () -> Pair<Boolean, Pair<K, V>>): Map<K, V> {
  return mutableMapOf<K, V>().apply {
    addFunctions.forEach {
      val (shouldAdd, pair) = it()
      if (shouldAdd) {
        put(pair.first, pair.second)
      }
    }
  }
}