solution for #105

This commit is contained in:
InsanusMokrassar 2021-10-28 18:46:53 +06:00
parent 8cd0775a6c
commit 67a1050646
2 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,9 @@
* `Common`: * `Common`:
* New type `Either` * New type `Either`
* `Serialization`:
* `TypedSerializer`
* New factory fun which accept vararg pairs of type and its serializer
## 0.7.3 ## 0.7.3

View File

@ -86,3 +86,7 @@ operator fun <T : Any> TypedSerializer<T>.minusAssign(kClass: KClass<T>) {
inline fun <reified T : Any> TypedSerializer( inline fun <reified T : Any> TypedSerializer(
presetSerializers: Map<String, KSerializer<out T>> = emptyMap() presetSerializers: Map<String, KSerializer<out T>> = emptyMap()
) = TypedSerializer(T::class, presetSerializers) ) = TypedSerializer(T::class, presetSerializers)
inline fun <reified T : Any> TypedSerializer(
vararg presetSerializers: Pair<String, KSerializer<out T>>
) = TypedSerializer(presetSerializers.toMap())