Is your feature request related to a problem? Please describe.
When when modelling an object using S.props it's currently possible to make a field "nullable or optional" using
myProp: S.prop(S.nullable(S.string))
myProp: S.prop(S.string).opt()
(1) results in accepting null or "some-str" as value and being parsed into myProp: O.Option<string>.
(2) results in accepting undefined, "some-str" or omitting the field and being parsed into byProp: string | undefined.
Describe the solution you'd like
I'd like something "in between". Basically something that allows me to omit a field like in (2) but being parsed into an option like in (1)
Describe alternatives you've considered
Additional context
Is your feature request related to a problem? Please describe.
When when modelling an object using
S.propsit's currently possible to make a field "nullable or optional" usingmyProp: S.prop(S.nullable(S.string))myProp: S.prop(S.string).opt()(1) results in accepting
nullor"some-str"as value and being parsed intomyProp: O.Option<string>.(2) results in accepting
undefined,"some-str"or omitting the field and being parsed intobyProp: string | undefined.Describe the solution you'd like
I'd like something "in between". Basically something that allows me to omit a field like in (2) but being parsed into an option like in (1)
Describe alternatives you've considered
Additional context