MCPcopy Create free account
hub / github.com/Effect-TS/effect / withConstructorDefault

Function withConstructorDefault

packages/effect/src/Schema.ts:5810–5817  ·  view source on GitHub ↗
(
  // `S["~type.make.in"]` instead of `S["Type"]` is intentional here because
  // it makes easier to define the default value if there are nested defaults
  defaultValue: Effect.Effect<S["~type.make.in"], SchemaIssue.Issue>
)

Source from the content-addressed store, hash-verified

5808 * @since 3.10.0
5809 */
5810export 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
5819function toIssueEffect<A, R>(
5820 self: Effect.Effect<A, SchemaError, R>

Callers 1

tagFunction · 0.70

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected