-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Refactor serial name of
ZeroAsByteSerializer
type
- Loading branch information
Showing
7 changed files
with
47 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...serialization/src/commonMain/kotlin/org/kotools/types/kotlinx/serialization/SerialName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.kotools.types.kotlinx.serialization | ||
|
||
@Suppress("unused") | ||
internal expect inline fun <reified T : Any> serialNameOf(): String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...x-serialization/src/jsMain/kotlin/org/kotools/types/kotlinx/serialization/JsSerialName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.kotools.types.kotlinx.serialization | ||
|
||
import kotools.types.internal.simpleNameOf | ||
|
||
internal actual inline fun <reified T : Any> serialNameOf(): String = | ||
simpleNameOf<T>() |
10 changes: 10 additions & 0 deletions
10
...jvmAndNativeMain/kotlin/org/kotools/types/kotlinx/serialization/JvmAndNativeSerialName.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.kotools.types.kotlinx.serialization | ||
|
||
import kotlin.reflect.KClass | ||
|
||
internal actual inline fun <reified T : Any> serialNameOf(): String { | ||
val type: KClass<T> = T::class | ||
return checkNotNull(type.qualifiedName) { | ||
"Getting qualified name of $type shouldn't return 'null'." | ||
} | ||
} |