You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cristianoc I recall you had some context around this, and there used to be some @optional-like annotations to make these more sound? Might be misremembering
Already discussed this one with @DZakh some time ago, but we did not really come to a conclusion and lost track of it.
When I have an object with a field of type
option<'a>
, e.g.and I serialize it using
S.serializeOrRaiseWith(obj, schema)
, I get the following JS object:I would prefer to get
i.e., having the field
b
with valueundefined
omitted.I know that
b
is stripped anyway when serializing the object to JSON usingJSON.stringify
, but:In other use cases, such as writing the object to IndexedDB, the
undefined
values are not stripped.The return type of
S.serializeOrRaiseWith
isJSON.t
which is defined asand therefore actually cannot have
undefined
values.The text was updated successfully, but these errors were encountered: