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

Function encodeUnknownEffect

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

Source from the content-addressed store, hash-verified

585 * @since 4.0.0
586 */
587export function encodeUnknownEffect<S extends Schema.Constraint>(
588 schema: S,
589 options?: SchemaAST.ParseOptions
590): (
591 input: unknown,
592 options?: SchemaAST.ParseOptions
593) => Effect.Effect<S["Encoded"], SchemaIssue.Issue, S["EncodingServices"]> {
594 const parser = run<S["Encoded"], S["EncodingServices"]>(SchemaAST.flip(schema.ast))
595 return options === undefined
596 ? parser
597 : (input, overrideOptions) => parser(input, mergeParseOptions(options, overrideOptions))
598}
599
600/**
601 * 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

mergeParseOptionsFunction · 0.85
runFunction · 0.70
flipMethod · 0.45

Tested by

no test coverage detected