I create an Obj like this.
interface obj {
x: number;
y: number;
deep?: {
z: number;
};
}
let obj: obj = {}; // Type '{}' is missing the following properties from type 'obj': x, y
^^^
I could use optional field.But when I want to access optional field I have to use nullish operator.
// But I don't want to use nullish operator
obj.deep?.z;
// without nullish operator.
obj.deep.z; // Object is possibly 'undefined'.
^^^^^^^^
// this is valid unless some condition (like is async function where its not "undefined" anymore);
Because optional field required nullish operator.I need some way to ignore "required properties" type error.