quiro
05/21/2024, 11:48 AM// kt
external interface Dress {
val color: Int
}
val dress: Dress = jso { color = ... }
and
// ts
const dress: Dress = { color: ... }
I'm noticing that the first is failing the serialization with fast-json-stringify
, while the second is passing it. If I stringify and parse the result with JSON.parse(JSON.stringify(dress))
then it passes the serialization successfully 🤔 Wondering if there's something in the instance created by jso
that is preventing the serializationturansky
05/21/2024, 2:09 PMturansky
05/21/2024, 2:53 PMjso
created (looks like this)quiro
05/21/2024, 3:13 PMquiro
05/21/2024, 3:16 PMexternal interface Base
external interface Derived: Base {
var property: String
}
val obj = jso { property = "" } // this fails to be serialized with fast-json-stringify
data class Derived2(val property: String) : Base
val obj2 = Derived2("") // this also fails to be serialized
data class Derived3(val property: String)
val obj3 = Derived3("") // this succeeds