I just discovered that `JSON.parse<T>()` won...
# javascript
p
I just discovered that
JSON.parse<T>()
won't fails with incorrect json and will continue works. For example:
Copy code
data class Car(val name: String)
val car = JSON.parse<Car>("{\"qwe\":123}")
This code will works and
car.name
will return undefined. Is there any way to check that json matches to specified structure?
And also one more thing:
car is Car
always return
false
(for correct and incorrect jsons both).