| 5808 | * @since 3.10.0 |
| 5809 | */ |
| 5810 | export function withConstructorDefault<S extends Constraint & WithoutConstructorDefault>( |
| 5811 | // `S["~type.make.in"]` instead of `S["Type"]` is intentional here because |
| 5812 | // it makes easier to define the default value if there are nested defaults |
| 5813 | defaultValue: Effect.Effect<S["~type.make.in"], SchemaIssue.Issue> |
| 5814 | ) { |
| 5815 | return (schema: S): withConstructorDefault<S> => |
| 5816 | make(SchemaAST.withConstructorDefault(schema.ast, defaultValue), { schema }) |
| 5817 | } |
| 5818 | |
| 5819 | function toIssueEffect<A, R>( |
| 5820 | self: Effect.Effect<A, SchemaError, R> |