This scenario applies to both scenarioOne
and scenarioTwo
:
type OptionalType = {y?: boolean};
const scenarioOne: OptionalType = { y: undefined };
const scenarioTwo: OptionalType = { };
I am seeking a solution where only scenarioTwo
would pass the type check.
Is there a method to define OptionalType
in such a way that enforces this requirement?
Appreciate your help!