mirror of
https://github.com/tursom/TursomServer.git
synced 2025-01-01 16:00:26 +08:00
fix Any.prettyJson() bug
This commit is contained in:
parent
79b947e30f
commit
f62f7fc636
@ -24,7 +24,7 @@ val prettyGson = GsonBuilder()
|
||||
.create()
|
||||
|
||||
fun Any.toJson(): String = gson.toJson(this)
|
||||
fun Any.toPrettyJson(): String = gson.toJson(this)
|
||||
fun Any.toPrettyJson(): String = prettyGson.toJson(this)
|
||||
inline fun <reified T : Any> String.fromJson(): T = gson.fromJson(this, T::class.java)
|
||||
|
||||
inline fun <reified T : Any> Gson.fromJson(json: String) = this.fromJson(json, T::class.java)!!
|
||||
|
Loading…
Reference in New Issue
Block a user