const mkSchema = (isC: boolean) => {
return {
a: "test",
b: 23,
...(isC ? {c: "whatever"} : {})
}
}
const a = mkSchema(true)
const b = mkSchema(false)
Hi. Why do the types of a and b are infered like
a: {
c?: string | undefined;
a: string;
b: number;
}
I expected to see c?: string instead.