const Foo = Schema.Struct({
bar: Schema.optionalWith(Schema.String, {
default: () => "baz",
}),
});
// all good
Foo.make({});
const FooWithNesting = Schema.Struct({
bar: Schema.Struct({
baz: Schema.optionalWith(Schema.String, {
default: () => "buzz",
}),
}),
});
// Property 'baz' is missing in type '{}' but required in type '{ readonly baz: string; }'.ts(2741)
FooWithNesting.make({
bar: {},
});
const Foo = Schema.Struct({
bar: Schema.optionalWith(Schema.String, {
default: () => "baz",
}),
});
// all good
Foo.make({});
const FooWithNesting = Schema.Struct({
bar: Schema.Struct({
baz: Schema.optionalWith(Schema.String, {
default: () => "buzz",
}),
}),
});
// Property 'baz' is missing in type '{}' but required in type '{ readonly baz: string; }'.ts(2741)
FooWithNesting.make({
bar: {},
});