Optional type make problem with following example.
type Example = {
key?: string;
};
const exampleLens = new LensGenerator<Example>().byProxy();
// TS emit an error with message `Object is possibly 'undefined'`
example.key.set()({})('abc');
This change will not make any problems with following case, since type parameters for LensSProxy will include undefined as a value of key.
Description
Optional type make problem with following example.
This change will not make any problems with following case, since type parameters for
LensSProxy
will includeundefined
as a value ofkey
.