Converting `undefined` and `null` to a missing value in TypeScript using Effect's schema transfor...
Does this seem like a sane way to convert
Context:
* I have some fields that should not be deletable in update operations
* The call-sites often have to deal with the values possibly being
* In the database I'm working with:
*
* If the field is missing in the update payload, it will leave the field alone in the database
* So...I want a schema that will remove the field from the payload if it's
It was bugging me that I could convert
undefined/null/<missing value> to just <missing value>?Context:
* I have some fields that should not be deletable in update operations
* The call-sites often have to deal with the values possibly being
undefined/null regardless of whether or not the intention is to delete a given field* In the database I'm working with:
*
null can mean "remove this field"* If the field is missing in the update payload, it will leave the field alone in the database
* So...I want a schema that will remove the field from the payload if it's
undefined/null to prevent anyone from unintentionally deleting the fieldIt was bugging me that I could convert
null to <missing value> but couldn't do the same for undefined