I want to convert a plain object (from json) to an...
# javascript
y
I want to convert a plain object (from json) to an instance of a class. For this I've defined
Copy code
external object Object {
    fun setPrototypeOf(plain: dynamic, prototype: dynamic): dynamic
}
and call it with
Object.plain(myPlainObject, kotlinext.js.Object.getPrototypeOf(type!!.js.asDynamic().prototype))
but it doesn't seem to work.
Well calling it with
Object.setPrototypeOf(obj, type!!.js.asDynamic().prototype)
is much better
But not enougth :/