Stripping Undefined Properties in Schema Encoding

Hi, is there anyway to have a schema upon encoding strip undefined properties? (instead of having them still be present but undefined value)

let fooSchema = Schema.Struct({ foo: Schema.optional(Schema.String)});
console.log(Schema.encodeSync(fooSchema)({foo: undefined})); // returns {foo: undefined}, but I want {}
Was this page helpful?