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

Function makeEffect

packages/effect/src/SchemaParser.ts:43–53  ·  view source on GitHub ↗
(schema: S)

Source from the content-addressed store, hash-verified

41 * @since 4.0.0
42 */
43export function makeEffect<S extends Schema.Constraint>(schema: S) {
44 const parser = runWithCompiler<S["Type"], never>(constructorCompiler, SchemaAST.toType(schema.ast))
45 return (input: S["~type.make.in"], options?: Schema.MakeOptions): Effect.Effect<S["Type"], SchemaIssue.Issue> => {
46 return parser(
47 input,
48 options?.disableChecks
49 ? options?.parseOptions ? { ...options.parseOptions, disableChecks: true } : { disableChecks: true }
50 : options?.parseOptions
51 )
52 }
53}
54
55/**
56 * Creates a synchronous maker that returns `Option.some` with the constructed

Callers 2

makeOptionFunction · 0.70
makeFunction · 0.70

Calls 1

runWithCompilerFunction · 0.85

Tested by

no test coverage detected