type xyz = { a:string,b:string }
type pqr = {c:string, d:string}
type test = xyz | pqr
const abc:test = {
a:"sdf",
b:"sdf",
c:"fd"
}
if("c" in abc){
console.log(abc.c)
console.log(abc.d)
}
in the above example, typescript doesn't throw any error, there is no key d in the object abc, any insights on this behavior of typescript in my opinion either it should not allow the partial or it should have checks to have key for both narrowing on basis of one key should be not allowed