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

Function encodeUnknownEffect

packages/effect/src/Schema.ts:1952–1960  ·  view source on GitHub ↗
(schema: S, options?: SchemaAST.ParseOptions)

Source from the content-addressed store, hash-verified

1950 * @since 4.0.0
1951 */
1952export function encodeUnknownEffect<S extends Constraint>(schema: S, options?: SchemaAST.ParseOptions) {
1953 const parser = SchemaParser.encodeUnknownEffect(schema, options)
1954 return (
1955 input: unknown,
1956 options?: SchemaAST.ParseOptions
1957 ): Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]> => {
1958 return fromIssueEffect(parser(input, options))
1959 }
1960}
1961/**
1962 * Encodes a typed input (the schema's `Type`) against a schema, returning an
1963 * `Effect` that succeeds with the encoded value or fails with a

Callers 2

encodeUnknownPromiseFunction · 0.70
encodeUnknownSyncFunction · 0.70

Calls 2

fromIssueEffectFunction · 0.85
parserFunction · 0.70

Tested by

no test coverage detected