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

Function decodeUnknownEffect

packages/effect/src/SchemaParser.ts:236–247  ·  view source on GitHub ↗
(
  schema: S,
  options?: SchemaAST.ParseOptions
)

Source from the content-addressed store, hash-verified

234 * @since 4.0.0
235 */
236export function decodeUnknownEffect<S extends Schema.Constraint>(
237 schema: S,
238 options?: SchemaAST.ParseOptions
239): (
240 input: unknown,
241 options?: SchemaAST.ParseOptions
242) => Effect.Effect<S["Type"], SchemaIssue.Issue, S["DecodingServices"]> {
243 const parser = run<S["Type"], S["DecodingServices"]>(schema.ast)
244 return options === undefined
245 ? parser
246 : (input, overrideOptions) => parser(input, mergeParseOptions(options, overrideOptions))
247}
248
249/**
250 * Creates an effectful decoder for input already typed as the schema's `Encoded`

Callers 5

decodeUnknownPromiseFunction · 0.70
decodeUnknownExitFunction · 0.70
decodeUnknownOptionFunction · 0.70
decodeUnknownResultFunction · 0.70
decodeUnknownSyncFunction · 0.70

Calls 2

mergeParseOptionsFunction · 0.85
runFunction · 0.70

Tested by

no test coverage detected