type T0 = {
a: string
b: string
}
type T1 = Omit<T0, 'b'>
function func({ param }: { param: T0 | T1 }) {
if (param.hasOwnProperty('b')) { /* reassign type */ }
return param.b
}
Is it possible to change the type of param
from T0 | T1
to T0
?