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

Function encodeUnknownEffect

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

Source from the content-addressed store, hash-verified

621 * @since 4.0.0
622 */
623export function encodeUnknownEffect<S extends Schema.Constraint>(
624 schema: S,
625 options?: SchemaAST.ParseOptions
626): (
627 input: unknown,
628 options?: SchemaAST.ParseOptions
629) => Effect.Effect<S["Encoded"], SchemaIssue.Issue, S["EncodingServices"]> {
630 const parser = run<S["Encoded"], S["EncodingServices"]>(SchemaAST.flip(schema.ast))
631 return withParseOptions(parser, options)
632}
633
634/**
635 * Creates an effectful encoder for input already typed as the schema's decoded

Callers 5

encodeUnknownPromiseFunction · 0.70
encodeUnknownExitFunction · 0.70
encodeUnknownOptionFunction · 0.70
encodeUnknownResultFunction · 0.70
encodeUnknownSyncFunction · 0.70

Calls 3

withParseOptionsFunction · 0.85
runFunction · 0.70
flipMethod · 0.65

Tested by

no test coverage detected