Previously, we did this to create the UserTraits type:
typealias UserTraits = MutableMap<String, Any>
However, when we wanted to create an object of UserTraits, what we did was:
val userTraits = mutableMapOf(
"email" to "a@a.com",
"external_id" to "user-12345"
)
It will confuse readers as we set the data type to be UserTraits, but use mutableMapOf when we want to instantiate it.
This PR fixes the issue by creating a new class called StringToAnyMap that extends from LinkedHashMap (the default implementation of mutableMapOf)
Previously, we did this to create the
UserTraits
type:However, when we wanted to create an object of
UserTraits
, what we did was:It will confuse readers as we set the data type to be
UserTraits
, but usemutableMapOf
when we want to instantiate it. This PR fixes the issue by creating a new class calledStringToAnyMap
that extends fromLinkedHashMap
(the default implementation ofmutableMapOf
)