i have a union type t3 where only one of the fields can be defined
type t1 = {
a: int;
b: undefined;
}
type t2 = {
a: undefined;
b: int;
}
type t3 = t1 | t2;
v1 and v2 are int | undefined but i know that only one of the values will be set. how can i assert that a is t3?
const { v1, v2 } = values
const a: t3 = {
a: v1,
b: v2,
}