is there a way to use contracts to safely assert t...
# javascript
b
is there a way to use contracts to safely assert types? looking at
Copy code
@OptIn(ExperimentalContracts::class)
fun isJsObject2(x: Any?): Boolean {
    contract { 
        returns(true) implies (x is Record<String, Any?>)
    }
    return jsTypeOf(x) == "object" && x !is Array<*> && x != null
}
but it's having trouble with erased types from external interfaces
1
t
b
wow, thanks