So I really like using type aliases in Kotlin, but I am wondering if my approach to it is considered to be bad, indifferent or good practice. See the following:
typealias MyAlias = Map<String, String>
fun MyAlias() : MyAlias = emptyMap()
fun MyAlias(vararg mapEntries: Pair<String, String>) : MyAlias = {
val map = mutableMapOf<String, String>
mapEntries.forEach{map[it.first] = it.second]}
return map
}
Thoughts? (May be a question subject to opinions, but I have seen some good discussions in the past with very helpful pointers, so I am hoping this will be one of those)