Using `Schema.validateSync` with `Schema.Struct.Field`

If I got the a schema that extends the type of Schema.Struct.Field (like when using Schema.optionalWith(), how do I use Schema.validateSync() on this? The validation methods only take a regular Schema.Schema. Thanks in advance!

import { Schema } from "effect"

const schema = Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null });
type Type = Schema.Schema.Type<typeof schema>;

Schema.validateSync(schema)(undefined);
                  // ^ errors 


https://effect.website/play#64dc9bf96b73
Was this page helpful?